]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoAllow truss to operate on ELFv2 processes.
jhibbits [Thu, 29 Nov 2018 03:57:06 +0000 (03:57 +0000)]
Allow truss to operate on ELFv2 processes.

Summary:
Currently, truss doesn't work on ELFv2 processes due to not recognizing the ABI.

Since there's no special handling needed here, just adding a PROCABI struct for
it is sufficient to get it working.

Submitted by: git_bdragon.rtk0.net
Differential Revision: https://reviews.freebsd.org/D18352

5 years agoTidy up hardclock.
mjg [Thu, 29 Nov 2018 03:44:02 +0000 (03:44 +0000)]
Tidy up hardclock.

- use fcmpset for updating ticks
- move (rarely used) itimer handling to a dedicated function

Sponsored by: The FreeBSD Foundation

5 years agoFix thread creation in PowerPC64 ELFv2 processes.
jhibbits [Thu, 29 Nov 2018 03:39:11 +0000 (03:39 +0000)]
Fix thread creation in PowerPC64 ELFv2 processes.

Summary:
Currently, the upcall used to create threads assumes ELFv1.

Instead, we should check which sysentvec is in use on the process and act
accordingly.

This makes ELFv2 threaded processes work.

Submitted by: git_bdragon.rtk0.net
Differential Revision: https://reviews.freebsd.org/D18330

5 years agoproc: create a dedicated lock for zombproc to ligthen the load on allproc_lock
mjg [Thu, 29 Nov 2018 02:52:08 +0000 (02:52 +0000)]
proc: create a dedicated lock for zombproc to ligthen the load on allproc_lock

waitpid always takes proctree to evaluate the list, but only takes allproc
if it can reap. With this patch allproc is no longer taken, which helps during
poudriere -j 128.

Discussed with: kib
Sponsored by: The FreeBSD Foundation

5 years agoMove CLIP table handling out of TOM and into the base driver.
jhb [Thu, 29 Nov 2018 01:15:53 +0000 (01:15 +0000)]
Move CLIP table handling out of TOM and into the base driver.

- Store the clip table in 'struct adapter' instead of in the TOM softc.
- Init the clip table during attach and teardown during detach.
- While here, add a dev.<nexus>.<unit>.misc.clip sysctl to dump the
  CLIP table.

This does mean that we update the clip table even if TOE is not enabled,
but non-TOE things need the CLIP table anyway.

Reviewed by: np, Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D18010

5 years agosh: Fix ${param?} default error message
jilles [Wed, 28 Nov 2018 20:03:53 +0000 (20:03 +0000)]
sh: Fix ${param?} default error message

If word in ${param?word} is missing, the shell shall write a default error
message. So expanding ${param?} when param is not set should write an error
message like

sh: param: parameter not set

This was broken by r316417.

PR: 233585

5 years agoFix yet another edge case in uma_startup_count(). If zone size fits into
glebius [Wed, 28 Nov 2018 19:54:02 +0000 (19:54 +0000)]
Fix yet another edge case in uma_startup_count(). If zone size fits into
several pages, but leaves no space for struct uma_slab at the end we
miscalculate number of pages by one. Totally mimic keg_large_init() math
here to cover that problem.

Reported by: gallatin

5 years agoFor not offpage zones the slab is placed at the end of page. Keg's uk_pgoff
glebius [Wed, 28 Nov 2018 19:17:27 +0000 (19:17 +0000)]
For not offpage zones the slab is placed at the end of page. Keg's uk_pgoff
is calculated to guarantee that struct uma_slab is placed at pointer size
alignment. Calculation of real struct uma_slab size is done in keg_ctor()
and yet again in keg_large_init(), to check if we need an extra page. This
calculation can actually be performed at compile time.

- Add SIZEOF_UMA_SLAB macro to calculate size of struct uma_slab placed at
  an end of a page with alignment requirement.
- Use SIZEOF_UMA_SLAB in keg_ctor() and in keg_large_init(). This is a not
  a functional change.
- Use SIZEOF_UMA_SLAB in UMA_SLAB_SPACE definition and in keg_small_init().
  This is a potential bugfix, but in reality I don't think there are any
  systems affected, since compiler aligns struct uma_slab anyway.

5 years agoAdd comments describing the bootargs handoff between loader(8) and gptboot
ian [Wed, 28 Nov 2018 18:09:42 +0000 (18:09 +0000)]
Add comments describing the bootargs handoff between loader(8) and gptboot
or zfsboot, when loader(8) is the BTX loader.  No functional changes.

5 years agoFix first-packet completion
shurd [Wed, 28 Nov 2018 17:37:17 +0000 (17:37 +0000)]
Fix first-packet completion

The first packet after the ring is initialized was never
completed as isc_txd_credits_update() would not include it in the
count of completed packets. This caused netmap to never complete
a batch. See PR 233022 for more details.

This is the same fix as the r340310 for e1000

PR: 233607
Reported by: lev
Reviewed by: lev
MFC after: 3 days
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D18368

5 years agopowerpc: Don't include KERNBASE in genassym, it's unnecessary
jhibbits [Wed, 28 Nov 2018 16:00:52 +0000 (16:00 +0000)]
powerpc: Don't include KERNBASE in genassym, it's unnecessary

A related future change, which changes KERNBASE for Book-E for some reason
causes a "KERNBASE redefined" error with assym.inc, even though it only changed
the value of KERNBASE and nothing else.  Since machine/vmparam.h is already
included in booke/locore.S, and the requisite guards are already in place for
properly handling KERNBASE in vmparam.h, just remove it from genassym, and
include vmparam.h in the AIM locore files.

5 years agocxgbe: revert r309725
vmaffione [Wed, 28 Nov 2018 15:29:58 +0000 (15:29 +0000)]
cxgbe: revert r309725

After the fix contained in r341144, cxgbe does not need anymore
to set the IFCAP_NETMAP flag manually.

Reviewed by: np
Approved by: gnn (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17987

5 years agonetmap: set IFCAP_NETMAP in if_capabilities
vmaffione [Wed, 28 Nov 2018 14:07:34 +0000 (14:07 +0000)]
netmap: set IFCAP_NETMAP in if_capabilities

Revision r307394 removed (by mistake) the code that sets IFCAP_NETMAP
in if_capabilities on netmap_attach. This patch reverts this change.

Reviewed by: np
Approved by: gnn (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17987

5 years agoarm64: Add rk_i2c and rk805 to GENERIC
manu [Wed, 28 Nov 2018 13:54:39 +0000 (13:54 +0000)]
arm64: Add rk_i2c and rk805 to GENERIC

MFC after: 1 month

5 years agoAdd RK805 PMIC Support
manu [Wed, 28 Nov 2018 13:53:43 +0000 (13:53 +0000)]
Add RK805 PMIC Support

RK805 is the companion PMIC for RK3328 SoC.
Add a driver for it with most of it's regulators supported.

MFC after: 1 month

5 years agork_clk_composite: Fix set_mux
manu [Wed, 28 Nov 2018 13:25:22 +0000 (13:25 +0000)]
rk_clk_composite: Fix set_mux

Pointy Hat:   manu

5 years agoAdd CAPABILITIES to the ERL kernel config so that tools that have been
sbruno [Wed, 28 Nov 2018 13:25:10 +0000 (13:25 +0000)]
Add CAPABILITIES to the ERL kernel config so that tools that have been
modified with Capsicum work on this target platform.

This came up after the conversion of wc(8).

5 years agosfxge(4): add outer IP ID parameter to TSOv2 descriptor
arybchik [Wed, 28 Nov 2018 09:25:43 +0000 (09:25 +0000)]
sfxge(4): add outer IP ID parameter to TSOv2 descriptor

Set outer_ip_id in the TX option descriptor for encapsulated packets.

Submitted by:   Vijay Srivastava <vijays at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18213

5 years agosfxge(4): add encapsulated TSOv2 capability
arybchik [Wed, 28 Nov 2018 09:25:31 +0000 (09:25 +0000)]
sfxge(4): add encapsulated TSOv2 capability

Submitted by:   Vijay Srivastava <vijays at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18212

5 years agosfxge(4): support CTPIO stats
arybchik [Wed, 28 Nov 2018 09:25:21 +0000 (09:25 +0000)]
sfxge(4): support CTPIO stats

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18211

5 years agosfxge(4): regenerate headers to pick up CTPIO stats
arybchik [Wed, 28 Nov 2018 09:25:09 +0000 (09:25 +0000)]
sfxge(4): regenerate headers to pick up CTPIO stats

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18210

5 years agosfxge(4): add bit to indicate CTPIO availability
arybchik [Wed, 28 Nov 2018 09:24:58 +0000 (09:24 +0000)]
sfxge(4): add bit to indicate CTPIO availability

Submitted by:   Guido Barzini <gbarzini at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18209

5 years agosfxge(4): add CTPIO statistics
arybchik [Wed, 28 Nov 2018 09:24:47 +0000 (09:24 +0000)]
sfxge(4): add CTPIO statistics

Submitted by:   Guido Barzini <gbarzini at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18208

5 years agosfxge(4): run genfwdef to update headers
arybchik [Wed, 28 Nov 2018 09:24:36 +0000 (09:24 +0000)]
sfxge(4): run genfwdef to update headers

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18207

5 years agosfxge(4): document the event type for CTPIO sends
arybchik [Wed, 28 Nov 2018 09:24:25 +0000 (09:24 +0000)]
sfxge(4): document the event type for CTPIO sends

Document the TX_EV_TYPE used for TX completion events corresponding
to CTPIO sends.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18206

5 years agosfxge(4): add 1.3V voltage and current sensors
arybchik [Wed, 28 Nov 2018 09:24:14 +0000 (09:24 +0000)]
sfxge(4): add 1.3V voltage and current sensors

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18205

5 years agosfxge(4): provide a flag for controlling CTPIO mode
arybchik [Wed, 28 Nov 2018 09:24:03 +0000 (09:24 +0000)]
sfxge(4): provide a flag for controlling CTPIO mode

Either cut-through or store-and-forward mode.

Submitted by:   Guido Barzini <gbarzini at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18204

5 years agosfxge(4): add Medford2 support for tunnel encapsulations
arybchik [Wed, 28 Nov 2018 09:23:52 +0000 (09:23 +0000)]
sfxge(4): add Medford2 support for tunnel encapsulations

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18203

5 years agosfxge(4): add Medford2 support for licensing
arybchik [Wed, 28 Nov 2018 09:23:41 +0000 (09:23 +0000)]
sfxge(4): add Medford2 support for licensing

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18202

5 years agosfxge(4): add Medford2 support for external port numbers
arybchik [Wed, 28 Nov 2018 09:23:30 +0000 (09:23 +0000)]
sfxge(4): add Medford2 support for external port numbers

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18201

5 years agosfxge(4): group Medford external port mapping entries
arybchik [Wed, 28 Nov 2018 09:23:19 +0000 (09:23 +0000)]
sfxge(4): group Medford external port mapping entries

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18200

5 years agosfxge(4): clarify port mode names and masks
arybchik [Wed, 28 Nov 2018 09:23:05 +0000 (09:23 +0000)]
sfxge(4): clarify port mode names and masks

New port mode names are defined for Medford2 and later, and
the existing names are aliased to them. Add comments with the
numeric port mode to clarify the external port modes table.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18199

5 years agosfxge(4): support Medford2 event timer semantics
arybchik [Wed, 28 Nov 2018 09:22:53 +0000 (09:22 +0000)]
sfxge(4): support Medford2 event timer semantics

The event timer interface has changed for Medford2 - for
details see bug66418 comment 9. Update the common code to
use the new timer semantics for Medford2.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18198

5 years agosfxge(4): support FEC mode settings
arybchik [Wed, 28 Nov 2018 09:22:42 +0000 (09:22 +0000)]
sfxge(4): support FEC mode settings

Medford2 controllers support control and reporting of
FEC modes for 25G and higher links. See SF-109306-TC
for suggested usage in client code.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18197

5 years agosfxge(4): remove obsolete comments
arybchik [Wed, 28 Nov 2018 06:56:34 +0000 (06:56 +0000)]
sfxge(4): remove obsolete comments

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18196

5 years agosfxge(4): move VI window size config to ef10 NIC board
arybchik [Wed, 28 Nov 2018 06:56:22 +0000 (06:56 +0000)]
sfxge(4): move VI window size config to ef10 NIC board

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18195

5 years agosfxge(4): move privilege config to ef10 NIC board config
arybchik [Wed, 28 Nov 2018 06:56:11 +0000 (06:56 +0000)]
sfxge(4): move privilege config to ef10 NIC board config

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18194

5 years agosfxge(4): move vector config to ef10 NIC board config
arybchik [Wed, 28 Nov 2018 06:55:59 +0000 (06:55 +0000)]
sfxge(4): move vector config to ef10 NIC board config

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18193

5 years agosfxge(4): move limits config to ef10 NIC board config
arybchik [Wed, 28 Nov 2018 06:55:47 +0000 (06:55 +0000)]
sfxge(4): move limits config to ef10 NIC board config

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18192

5 years agosfxge(4): move Tx config to ef10 NIC board config
arybchik [Wed, 28 Nov 2018 06:55:36 +0000 (06:55 +0000)]
sfxge(4): move Tx config to ef10 NIC board config

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18191

5 years agosfxge(4): move Rx config to ef10 NIC board config
arybchik [Wed, 28 Nov 2018 06:55:24 +0000 (06:55 +0000)]
sfxge(4): move Rx config to ef10 NIC board config

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18190

5 years agosfxge(4): move datapath config to ef10 NIC board cfg
arybchik [Wed, 28 Nov 2018 06:55:12 +0000 (06:55 +0000)]
sfxge(4): move datapath config to ef10 NIC board cfg

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18189

5 years agosfxge(4): move PHY/link config to ef10 NIC board cfg
arybchik [Wed, 28 Nov 2018 06:55:00 +0000 (06:55 +0000)]
sfxge(4): move PHY/link config to ef10 NIC board cfg

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18188

5 years agosfxge(4): move legacy board config to ef10 NIC board cfg
arybchik [Wed, 28 Nov 2018 06:54:49 +0000 (06:54 +0000)]
sfxge(4): move legacy board config to ef10 NIC board cfg

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18187

5 years agosfxge(4): move MAC address config to ef10 NIC board cfg
arybchik [Wed, 28 Nov 2018 06:54:37 +0000 (06:54 +0000)]
sfxge(4): move MAC address config to ef10 NIC board cfg

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18186

5 years agosfxge(4): move PF/VF config to ef10 NIC board config
arybchik [Wed, 28 Nov 2018 06:54:25 +0000 (06:54 +0000)]
sfxge(4): move PF/VF config to ef10 NIC board config

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18185

5 years agosfxge(4): move port config to ef10 NIC board config
arybchik [Wed, 28 Nov 2018 06:54:13 +0000 (06:54 +0000)]
sfxge(4): move port config to ef10 NIC board config

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18184

5 years agosfxge(4): pacify false positive warning
arybchik [Wed, 28 Nov 2018 06:54:02 +0000 (06:54 +0000)]
sfxge(4): pacify false positive warning

The warning says that it may be usage of possibly uninitialized value.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18183

5 years agosfxge(4): add ef10 NIC board config method
arybchik [Wed, 28 Nov 2018 06:53:51 +0000 (06:53 +0000)]
sfxge(4): add ef10 NIC board config method

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18182

5 years agosfxge(4): use correct name for frame truncation event
arybchik [Wed, 28 Nov 2018 06:53:40 +0000 (06:53 +0000)]
sfxge(4): use correct name for frame truncation event

The RX_ECC_ERR flag in RX events was misnamed, as it
reported frame truncation. Use the new RX_TRUNC_ERR
name for this flag.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18181

5 years agopowerpc/booke: Fix debug printfs in pmap
jhibbits [Wed, 28 Nov 2018 04:02:26 +0000 (04:02 +0000)]
powerpc/booke: Fix debug printfs in pmap

Add missing '%'s so printf formats are actually handled.

5 years agopowerpc: Fix the powerpc64 build post-r341102
jhibbits [Wed, 28 Nov 2018 02:48:43 +0000 (02:48 +0000)]
powerpc: Fix the powerpc64 build post-r341102

VM_MIN_KERNEL_ADDRESS is now used in locore.S, but the UL suffix isn't
permitted in .S files.

5 years agopowerpc: Prepare Book-E kernels for KERNBASE != run base
jhibbits [Wed, 28 Nov 2018 02:00:27 +0000 (02:00 +0000)]
powerpc: Prepare Book-E kernels for KERNBASE != run base

Book-E kernels really run at VM_MIN_KERNEL_ADDRESS, which currently happens to
be the same as KERNBASE.  KERNBASE is the linked address, which the loader also
takes to be the physical load address.  Treat KERNBASE as a physical address,
not a virtual, and change virtual address references for KERNBASE to use
something more appropriate.

5 years agopowerpcspe: Don't crash the loader on ubldr with SPE instructions.
jhibbits [Wed, 28 Nov 2018 01:47:01 +0000 (01:47 +0000)]
powerpcspe: Don't crash the loader on ubldr with SPE instructions.

-msoft-float seems to be insufficient for disabling the SPE on powerpcspe.
Force it off with -mno-spe as well.  This prevents a crash in ubldr on
powerpcspe.

5 years agoAdd read-only sysctls for all tunables in the cxgbe(4) driver.
jhb [Tue, 27 Nov 2018 22:02:54 +0000 (22:02 +0000)]
Add read-only sysctls for all tunables in the cxgbe(4) driver.

Reviewed by: np
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D18360

5 years agosh: Use 126 and 127 exit status for failures opening a script
jilles [Tue, 27 Nov 2018 21:49:59 +0000 (21:49 +0000)]
sh: Use 126 and 127 exit status for failures opening a script

This affects scripts named on the command line, named with a '.' special
builtin and found via the PATH %func autoloading mechanism.

PR: 231986

5 years agoFix assert condition in pmap_large_unmap().
kib [Tue, 27 Nov 2018 21:40:51 +0000 (21:40 +0000)]
Fix assert condition in pmap_large_unmap().

pmap_large_unmap() asserts that an unmapping request covers the
entirety of a 2M or 1G page.  The logic in the asserts was out of date
with the loop logic.  Correct the test to actually check that
destroying the current superpage mapping does not unmap addresses
beyond those requested by the caller.

Submitted by: D Scott Phillips <d.scott.phillips@intel.com>
Reviewed by: alc
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D18345

5 years agoUse busdma unconditionally in iflib
gallatin [Tue, 27 Nov 2018 20:01:05 +0000 (20:01 +0000)]
Use busdma unconditionally in iflib

- Remove the complex mechanism to choose between using busdma
and raw pmap_kextract at runtime.   The reduced complexity makes
the code easier to read and maintain.

- Fix a bug in the small packet receive path where clusters were
repeatedly mapped but never unmapped. We now store the cluster's
bus address and avoid re-mapping the cluster each time a small
packet is received.

This patch fixes bugs I've seen where ixl(4) will not even
respond to ping without seeing DMAR faults.

I see a small improvement (14%) on packet forwarding tests using
a Haswell based Xeon E5-2697 v3.  Olivier sees a small
regression (-3% to -6%) with lower end hardware.

Reviewed by: mmacy
Not objected to by: sbruno
MFC after: 8 weeks
Sponsored by: Netflix, Inc
Differential Revision: https://reviews.freebsd.org/D17901

5 years agoImprove sigonstack().
kib [Tue, 27 Nov 2018 19:50:58 +0000 (19:50 +0000)]
Improve sigonstack().

Avoid relying on unsigned overflow for the test.
Simplify expressions to avoid duplicate check for the range.
Style.
Add herald comment.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D18361

5 years agoIn hardened systems, where the security.bsd.unprivileged_proc_debug sysctl
jamie [Tue, 27 Nov 2018 17:51:50 +0000 (17:51 +0000)]
In hardened systems, where the security.bsd.unprivileged_proc_debug sysctl
node is set, allow setting security.bsd.unprivileged_proc_debug per-jail.
In part, this is needed to create jails in which the Address Sanitizer
(ASAN) fully works as ASAN utilizes libkvm to inspect the virtual address
space. Instead of having to allow unprivileged process debugging for the
entire system, allow setting it on a per-jail basis.

The sysctl node is still security.bsd.unprivileged_proc_debug and the
jail(8) param is allow.unprivileged_proc_debug. The sysctl code is now a
sysctl proc rather than a sysctl int. This allows us to determine setting
the flag for the corresponding jail (or prison0).

As part of the change, the dynamic allow.* API needed to be modified to
take into account pr_allow flags which may now be disabled in prison0.
This prevents conflicts with new pr_allow flags (like that of vmm(4)) that
are added (and removed) dynamically.

Also teach the jail creation KPI to allow differences for certain pr_allow
flags between the parent and child jail. This can happen when unprivileged
process debugging is disabled in the parent prison, but enabled in the
child.

Submitted by: Shawn Webb <lattera at gmail.com>
Obtained from: HardenedBSD (45b3625edba0f73b3e3890b1ec3d0d1e95fd47e1deba0b5078cef0faae43cbdafed3035b16587afcab21eeb3b4c72f2500987c96ff603ccf3b6e7de8)
Relnotes: yes
Sponsored by: HardenedBSD and G2, Inc
Differential Revision: https://reviews.freebsd.org/D18319

5 years agoDo not limit the mbuf queue length for keepalive packets.
ae [Tue, 27 Nov 2018 16:51:01 +0000 (16:51 +0000)]
Do not limit the mbuf queue length for keepalive packets.

It was unlimited before overhaul, and one user reported that this limit
can be reached easily.

PR: 233562
MFC after: 1 week

5 years agoWhen deciding whether to send the complete URL or just the document part,
des [Tue, 27 Nov 2018 16:23:17 +0000 (16:23 +0000)]
When deciding whether to send the complete URL or just the document part,
we were looking at the original URL rather than the one we were currently
processing.  This meant that if we were trying to retrieve an HTTP URL but
were redirected to an HTTPS URL, and HTTPS proxying was enabled, we would
send an invalid request and most likely get garbage back.

MFC after: 3 days

5 years agoRestore the ability to override the disk unit/partition at the boot: prompt
ian [Tue, 27 Nov 2018 16:16:38 +0000 (16:16 +0000)]
Restore the ability to override the disk unit/partition at the boot: prompt
in gptboot.

When arch-independent geli support was added, a new static 'gdsk' struct
was added, but there was still a static 'dsk' struct, and when you typed
in an alternate disk/partition, the string was parsed into that struct,
which was then never used for anything.  Now the string gets parsed into
gdsk.dsk, the struct that's actually used.

X-MFC after: 3 days

5 years agoMake whitespace more consistent in libkqueue tests.
dab [Tue, 27 Nov 2018 15:12:34 +0000 (15:12 +0000)]
Make whitespace more consistent in libkqueue tests.

After r337820, which "corrected" some spaces-instead-of-tab whitespace
issues in the libkqueue tests, jmg@ pointed out that these files were
originally space-based, not tab-spaced, and so the correction should
have been to get rid of the tabs that had been introduced in previous
changes, not the spaces. This change does that. This is a whitespace
only change; no functional change is intended.

Reported by: jmg@
MFC after: 3 days
Sponsored by: Dell EMC Isilon

5 years agoAdd a “skip_dsn” option to g_part's bootcode verb to prevent g_part_mbr
des [Tue, 27 Nov 2018 14:58:19 +0000 (14:58 +0000)]
Add a “skip_dsn” option to g_part's bootcode verb to prevent g_part_mbr
from setting the volume serial number.  This unbreaks older boot blocks
that don't support serial numbers, and allows boot0cfg to set the serial
number itself if requested by the user.

Submitted by: lev@, yuripv@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17386

5 years agosfxge(4): remove MAC stats size define
arybchik [Tue, 27 Nov 2018 14:16:14 +0000 (14:16 +0000)]
sfxge(4): remove MAC stats size define

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18180

5 years agosfxge(4): resolve code analysis warnings
arybchik [Tue, 27 Nov 2018 14:16:03 +0000 (14:16 +0000)]
sfxge(4): resolve code analysis warnings

Minimal changes adding buffer size checks and simplifying checksum
processing.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18179

5 years agosfxge(4): decode Medford2 FEC stats if available
arybchik [Tue, 27 Nov 2018 14:15:52 +0000 (14:15 +0000)]
sfxge(4): decode Medford2 FEC stats if available

Decode Medford2 FEC stats if available in MAC stats DMA buffer.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18178

5 years agosfxge(4): run mkconfig.py to add FEC MAC stats
arybchik [Tue, 27 Nov 2018 14:15:41 +0000 (14:15 +0000)]
sfxge(4): run mkconfig.py to add FEC MAC stats

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18177

5 years agosfxge(4): use MAC stats DMA buffer size when decoding
arybchik [Tue, 27 Nov 2018 14:15:30 +0000 (14:15 +0000)]
sfxge(4): use MAC stats DMA buffer size when decoding

On Medford2 and later the MAC stats buffer has been enlarged.
Use the MAC stats DMA buffer size to ensure that the stats END
generation count is read from the correct location, and that
over-reading of the DMA buffer is prevented.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18176

5 years agosfxge(4): use MAC stats DMA buffer size from caps
arybchik [Tue, 27 Nov 2018 14:15:19 +0000 (14:15 +0000)]
sfxge(4): use MAC stats DMA buffer size from caps

For Medford2 the DMA buffer used for one-shot or periodic MAC stats
has been extended. Ensure the MAC stats DMA buffer size is large
enough to hold the number of stats counters supported by firmware.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18175

5 years agosfxge(4): improve robustness of MAC stats get via MCDI
arybchik [Tue, 27 Nov 2018 14:15:08 +0000 (14:15 +0000)]
sfxge(4): improve robustness of MAC stats get via MCDI

Previously the code relied on the callers of efx_mcdi_mac_stats
to provide a DMA buffer or NULL depending on the action. Fix
this so that the DMA buffer is only passed in the request when
needed, and that an error is reported for a missing DMA buffer.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18174

5 years agosfxge(4): retrieve number of MAC stats from NIC
arybchik [Tue, 27 Nov 2018 14:14:57 +0000 (14:14 +0000)]
sfxge(4): retrieve number of MAC stats from NIC

This reports the number of stats (and hence the DMA buffer size)
for MAC stats. If MC_GET_CAPABABILITIES_V4 is not supported then
use the legacy Siena-compatible MC_CMD_MAC_NSTATS value.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18173

5 years agosfxge(4): refactor EF10 get datapath capabilities
arybchik [Tue, 27 Nov 2018 14:14:45 +0000 (14:14 +0000)]
sfxge(4): refactor EF10 get datapath capabilities

Inline efx_mcdi_get_capabilities() to prepare for reading
newer capabilities response versions.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18172

5 years agollvm-objdump.1: remove more unintentional options
emaste [Tue, 27 Nov 2018 13:52:51 +0000 (13:52 +0000)]
llvm-objdump.1: remove more unintentional options

Some options come from static constructors in LLVM libraries and are
automatically added to llvm's usage output.  They're not really supposed
to be llvm-objdump options.

Reported by: Fangrui Song in LLVM review D54864
Sponsored by: The FreeBSD Foundation

5 years agosfxge(4): handle new speeds in link events
arybchik [Tue, 27 Nov 2018 13:00:51 +0000 (13:00 +0000)]
sfxge(4): handle new speeds in link events

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18170

5 years agosfxge(4): add efsys macro to get memory region size
arybchik [Tue, 27 Nov 2018 13:00:39 +0000 (13:00 +0000)]
sfxge(4): add efsys macro to get memory region size

EFSYS_MEM_SIZE() reports the DMA mapped size of an efsys_mem_t
allocated region (the allocation size may be different due to
memory allocator and DMA alignment restrictions).

This ensures that common code internals have explicit knowledge
of the usable size of DMA mapped memory regions.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18170

5 years agosfxge(4): add new loopback modes
arybchik [Tue, 27 Nov 2018 13:00:28 +0000 (13:00 +0000)]
sfxge(4): add new loopback modes

Report supported loopback modes for new Medford2 link speeds.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18169

5 years agosfxge(4): support new link modes
arybchik [Tue, 27 Nov 2018 13:00:17 +0000 (13:00 +0000)]
sfxge(4): support new link modes

Add basic support for new link modes for Medford2.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18168

5 years agosfxge(4): removing unneeded assert
arybchik [Tue, 27 Nov 2018 13:00:06 +0000 (13:00 +0000)]
sfxge(4): removing unneeded assert

Remove ASSERT() from sfxge_link_mode_to_phy_cap() which causes an
unnecessary panic, even though the callers have proper error handling.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18167

5 years agosfxge(4): simplify loopback type checking
arybchik [Tue, 27 Nov 2018 12:59:55 +0000 (12:59 +0000)]
sfxge(4): simplify loopback type checking

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18166

5 years agosfxge(4): report memory BAR number
arybchik [Tue, 27 Nov 2018 12:59:43 +0000 (12:59 +0000)]
sfxge(4): report memory BAR number

Remove EFX_MEM_BAR define as it it is not correct on all platforms.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18165

5 years agosfxge(4): update notes on interrupt testing on VFs
arybchik [Tue, 27 Nov 2018 12:59:32 +0000 (12:59 +0000)]
sfxge(4): update notes on interrupt testing on VFs

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18164

5 years agosfxge(4): fix ICC warning because of non-enum value usage
arybchik [Tue, 27 Nov 2018 12:59:21 +0000 (12:59 +0000)]
sfxge(4): fix ICC warning because of non-enum value usage

Fix ICC warning because of non-enum value asignment to enum variable.

Found by upstreaming to DPDK.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18163

5 years agosfxge(4): refactoring eliminating code analysis warnings
arybchik [Tue, 27 Nov 2018 12:59:09 +0000 (12:59 +0000)]
sfxge(4): refactoring eliminating code analysis warnings

Addresses most of the warnings reported by the sfn windows driver.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18162

5 years agosfxge(4): update hardware headers for Medford2
arybchik [Tue, 27 Nov 2018 12:58:52 +0000 (12:58 +0000)]
sfxge(4): update hardware headers for Medford2

The changes to efx_regs_ef10.h are auto-generated and include:

 - Updated event RX_L4_CLASS which is now 2 bits (was 3).
   The encoding of TCP, UDP and UNKNOWN are unchanged so
   the narrower Medford2 field definition is compatible with
   all controllers.

 - Fix definition of FATSOv2 option descriptors. These were
   added manually and differ from the auto-generated values
   in some fields (not yet used in common code). The field
   definitions have been corrected to agree with the Linux net
   driver headers and SF-108452-SW.

The remaining changes adapt the common code to use the updated
headers.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18161

5 years agoImport CK as of 21d3e319407d19dece16ee317c757ffc54a452bc, which makes its
marius [Tue, 27 Nov 2018 12:35:51 +0000 (12:35 +0000)]
Import CK as of 21d3e319407d19dece16ee317c757ffc54a452bc, which makes its
sparcv9 atomics compatible with the FreeBSD kernel by using instructions
which access the appropriate address space.
Atomic operations within the kernel must access the nucleus address space
instead of the default primary one. Without this change but the increased
use of CK in the kernel, machines started to panic after some minutes of
uptime due to an unresolvable fault in ck_pr_cas_64_value().

5 years agosfxge(4): add method to make checksum option descriptors
arybchik [Tue, 27 Nov 2018 12:23:01 +0000 (12:23 +0000)]
sfxge(4): add method to make checksum option descriptors

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18160

5 years agosfxge(4): improve comments for EF10 ext port mapping
arybchik [Tue, 27 Nov 2018 12:22:50 +0000 (12:22 +0000)]
sfxge(4): improve comments for EF10 ext port mapping

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18159

5 years agosfxge(4): support runtime VI window size
arybchik [Tue, 27 Nov 2018 12:22:37 +0000 (12:22 +0000)]
sfxge(4): support runtime VI window size

Medford2 uses a configurable VI window size, and requires
updates to register accesses to use a runtime VI window size
rather than the *_STEP register constants used for earlier
controllers.

Update the common code to query the VI window size via MCDI,
and add new EFX_BAR_VI_* accessor macros for per-VI registers.

The existing EFX_BAR_TBL_* macros can be used for non-VI
register tables (and for code that can never be called for
a Medford2 controller e.g. Siena-only code).

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18158

5 years agosfxge(4): add Medford2 support to MON module
arybchik [Tue, 27 Nov 2018 12:22:25 +0000 (12:22 +0000)]
sfxge(4): add Medford2 support to MON module

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18157

5 years agosfxge(4): add Medford2 support to VPD module
arybchik [Tue, 27 Nov 2018 12:22:14 +0000 (12:22 +0000)]
sfxge(4): add Medford2 support to VPD module

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18156

5 years agosfxge(4): add Medford2 support to BOOTCFG module
arybchik [Tue, 27 Nov 2018 12:22:03 +0000 (12:22 +0000)]
sfxge(4): add Medford2 support to BOOTCFG module

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18155

5 years agosfxge(4): add Medford2 support to SRAM module
arybchik [Tue, 27 Nov 2018 12:21:53 +0000 (12:21 +0000)]
sfxge(4): add Medford2 support to SRAM module

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18154

5 years agosfxge(4): add Medford2 support to NVRAM module
arybchik [Tue, 27 Nov 2018 12:21:41 +0000 (12:21 +0000)]
sfxge(4): add Medford2 support to NVRAM module

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18153

5 years agosfxge(4): add Medford2 support to Tx module
arybchik [Tue, 27 Nov 2018 12:21:30 +0000 (12:21 +0000)]
sfxge(4): add Medford2 support to Tx module

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18152

5 years agosfxge(4): add Medford2 support to Rx module
arybchik [Tue, 27 Nov 2018 12:21:19 +0000 (12:21 +0000)]
sfxge(4): add Medford2 support to Rx module

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18151

5 years agosfxge(4): add Medford2 support to PHY module
arybchik [Tue, 27 Nov 2018 12:21:08 +0000 (12:21 +0000)]
sfxge(4): add Medford2 support to PHY module

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18150

5 years agosfxge(4): add Medford2 support to MCDI module
arybchik [Tue, 27 Nov 2018 12:20:57 +0000 (12:20 +0000)]
sfxge(4): add Medford2 support to MCDI module

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18149

5 years agosfxge(4): add Medford2 support to MAC module
arybchik [Tue, 27 Nov 2018 12:20:46 +0000 (12:20 +0000)]
sfxge(4): add Medford2 support to MAC module

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18148