Commit Graph

245779 Commits

Author SHA1 Message Date
Edward Tomasz Napierala
75ad2fd059 Humanize more columns in the vmstat(8) output and adjust widths.
The few columns that are not humanized are usually 0.  This makes
the output mostly aligned.

Reviewed by:	allanjude
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D22185
2019-11-08 11:09:50 +00:00
Rick Macklem
b2ea509012 Fix the man page to correctly describe the use of the "len" argument.
The man page incorrectly described the use of the"len" argument, which
is updated to the number of bytes copied and not reduced by the number
of bytes copied.

This is a content change.
2019-11-08 06:40:17 +00:00
Justin Hibbits
55073c7837 powerpc/booke: Only handle kernel page faults in KVA range
The memory range between VM_MAXUSER_ADDRESS and VM_MIN_KERNEL_ADDRESS is
reserved for devices currently, which are always mapped in TLB1, and
therefore do not exist in the kernel page table.  Any page fault in this
range is therefore automatically a fatal fault.
2019-11-08 04:26:19 +00:00
Justin Hibbits
d3895bffd9 powerpc/booke: Make the TLB save area and mask match
Since TLB_MAXNEST is 3, the insert mask should only be 2 bits.  Given that 2
bits counts to 4, and that we already have plenty of space wasted in
padding, make the nest level 4 to match the mask.
2019-11-08 03:45:13 +00:00
Justin Hibbits
9e2b2d6996 powerpc/mpc85xx: Add MSI support for Freescale PowerPC SoCs
Freescale SoCs use a set of IRQs at the high end of the OpenPIC IRQ
list, not counted in the NIRQs of the Feature reporting register.  Some
SoCs include a MSI inbound window in the PCIe controller configuration
registers as well, but some don't.  Currently, this only handles the
SoCs *with* the MSI window.

There are 256 MSIs per MSI bank (32 per MSI IRQ, 8 IRQs per MSI bank).
The P5020 has 3 banks, yielding up to 768 MSIs; older SoCs have only one
bank.
2019-11-08 03:36:19 +00:00
Kyle Evans
c23f22a973 bcm2835_dma: Mark IRQs shareable
On the RPi4, some of these IRQs are shared. Start moving toward a mode where
we accept that shared IRQs happen and simply ignore interrupts that are
seemingly for no reason.

I would like to be more verbose here, but my 30-minute assessment of the
current world order is that mapping a resource/rid to an actual IRQ number
(as found in FDT) data is not a simple matter. Determining if more than one
handler is attached to an IRQ is closer to feasible, but it's unclear which
way is the cleaner path. Beyond that, we're only really using it to be
slightly more verbose when something's going wrong, so for now just suppress
and drop a complaint-comment.

This was originally submitted (via freebsd-arm@) by Robert Crowston; the
additional verbosity was dropped by kevans@.

Submitted by:	Robert Crowston <crowston@protonmail.com>
2019-11-08 03:27:56 +00:00
Brooks Davis
976716664f Turn the error about a lack of LIBCOMPAT into a warning.
Add some diagnostic output.

This works around the fact that buildworld calls cleandir in libexec
with the wrong MACHINE_ARCH (i386 on amd64) when the OBJ directory is empty.

Reported by:	bdragon, jkim
2019-11-08 03:14:06 +00:00
Navdeep Parhar
43b5712444 cxgbe(4): Query Vdd from the firmware if its last known value is 0.
TVSENSE may not be ready by the time t4_fw_initialize returns and the
firmware returns 0 if the driver asks for the Vdd before the sensor is
ready.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2019-11-08 01:13:12 +00:00
Mark Johnston
2ff4dd5e82 Document iwm(4) support for 9000-series devices.
Sponsored by:	The FreeBSD Foundation
2019-11-08 00:01:37 +00:00
Li-Wen Hsu
12c4ab4377 Get the fix in back by reverting the part accidentally included in r354491.
This brings back r354467.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:57:48 +00:00
Brooks Davis
55c2583a16 Revert r354518 and commit the intented fix rather than the diagnostic
check.

This fixes the definition of MK_LIB32 in Makefile.inc1.
2019-11-07 23:54:40 +00:00
Brooks Davis
99519f2120 Fix the ARCH check for LIB32 from Makefile.inc1. 2019-11-07 23:50:33 +00:00
Mark Johnston
ad27496d29 Update iwm and iwmfw man pages with info about 9000-series chips.
Thanks to bapt, bz, cem, woodsb02, Neel Chauhan and Salvador Martínez
Mármol for helping test the initial 9000-series support.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:39:33 +00:00
Mark Johnston
1903c60041 iwm: Sync device initialization and reset code with iwlwifi.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:39:17 +00:00
Mark Johnston
666c8655f2 iwm: Implement support for scans with "adaptive" dwell time.
This is required by 9000-series firmware.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:39:04 +00:00
Mark Johnston
c513f15bf0 iwm: Use the default station for all transmits.
This is what iwlwifi seems to do, and the previous behaviour triggered
firmware panics during transmit on a 9560.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:38:49 +00:00
Mark Johnston
d2c7b21a56 iwm: Set flag for pad bytes in offload_assist.
Though we don't otherwise use firmware's offload capabilities, we need
to set this flag when the MAC header's size isn't a multiple of four.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:38:36 +00:00
Mark Johnston
49c76634fb iwm: Use antenna B for TX on 9000-series chips.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:38:17 +00:00
Mark Johnston
09a07cd5ea iwm: Update the station add command for the new RX API.
The firmware expects a new version of the add-station command in
9000-series chips.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:37:55 +00:00
Mark Johnston
c3bfecf3df iwm: Sync with iwm_run_init_mvm_ucode() with iwlwifi.
Do not configure bluetooth on newer chips, it causes firmware panics.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:37:30 +00:00
Mark Johnston
1f0976dc58 iwm: Fix scheduler configuration for aux and cmd queue configuration.
- Configure the scheduler only for the management queue.
- Fix a bug when enabling the schduler: the queues are specified using a
  bitmask.
- Fix style in the area.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:37:17 +00:00
Mark Johnston
96c5aa2f4b iwm: Implement the new receive path.
This is the multiqueue receive code required for 9000-series chips.
Note that we still only configure a single RX queue for now.  Multiqueue
support will require MSI-X configuration and a scheme for managing a
global pool of RX buffers.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:37:02 +00:00
Mark Johnston
2ca43dacca iwm: Enable all 31 tx queues.
For now iwm only ever uses queue 0 and the management queue, but my 9560
raises a software error interrupt during initialization if this flag is
not set.  iwlwifi sets it for all 7000- and 8000-series hardware, so we
might as well do it unconditionally.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:36:46 +00:00
Mark Johnston
b1a48ccc18 iwm: Explicitly enable MSI on newer chipsets.
9000-series chips implement support for MSI-X interrupts and disable MSI
by default.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:36:25 +00:00
Mark Johnston
1809534a1a iwm: Define the mqrx_supported capability.
The firmware for 9000-series and newer devices has a different receive
API which supports multiple queues.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:36:10 +00:00
Mark Johnston
5b3b7a2df1 iwm: Add device configuration definitions for 9000-series chips.
Match such chips using the device ID.  We should really be checking the
subdevice as well, since a smaller number of 9460 and 9560 devices
actually belong to a new series of devices and require different
firmware, but that will require some extra logic in iwm_attach().

Submitted by:	lwhsu, Guo Wen Jun <blockk2000@gmail.com>
MFC after:	2 weeks
2019-11-07 23:35:54 +00:00
Mark Johnston
d2ec5b521b iwm: Sync the firmware tx_cmd descriptor fields with iwlwifi.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:35:29 +00:00
Mark Johnston
be05a0fd77 iwm: Use the same delays as iwlwifi when resetting the device.
This is required for initialization to succeed for newer device
families.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:35:15 +00:00
Mark Johnston
3bf2d5dd64 iwm: Add a device family definition for 9000 chips.
Convert existing device family checks to avoid assuming that the device
family is always one of IWM_DEVICE_FAMILY_7000 or _8000.

Submitted by:	lwhsu, Guo Wen Jun <blockk2000@gmail.com>
MFC after:	2 weeks
2019-11-07 23:35:01 +00:00
Mark Johnston
381471bc83 iwm: Add 9000-series RX register definitions.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:34:41 +00:00
Mark Johnston
4e5deb6734 iwm: Add a few _prph functions needed for 9000-series chips.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:34:28 +00:00
Mark Johnston
9dd2749044 iwm: Sync the TLV API enum with iwlwifi.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:34:12 +00:00
Mark Johnston
267c626f0d iwm: Define a name for TLV 48.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:33:58 +00:00
Mark Johnston
b41c219912 iwm: Avoid calling iwm_start() each time a descriptor is reclaimed.
Only perform the call when a qfull bit transitions.  While here, avoid
assignments in declarations in iwm_mvm_rx_tx_cmd().

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:29:57 +00:00
Mark Johnston
3cc50d22fd iwm: Call iwm_dev_check() earlier in iwm_attach().
This ensures that the driver softc reflects device capabilities as early
as possible, for use by device initialization code that is conditional
on certain capabilities.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:29:43 +00:00
Mark Johnston
eff8a9793e iwm: Simplify fw_has_{api,capa}().
No functional change intended.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:29:25 +00:00
Mark Johnston
22a4c7bcb3 iwm: Remove a couple of unused fields from the softc.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:29:00 +00:00
Mark Johnston
113875bd68 iwm: Fix style in the TX path.
Also ensure that the htole* macros are applied correctly when specifying
the segment length and upper address bits.  No functional change
intended (unless you use iwm(4) on a big-endian machine).

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:27:54 +00:00
Brooks Davis
a4330302f2 libcompat: build 32-bit rtld and ldd as part of "everything"
Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included
directly so MD paths in Makefiles work. In the process centralize
setting them in LIBCOMPATWMAKEENV.

Alter .PATH and CFLAGS settings in work when the Makefile is included.

While here only support LIB32 on supported platforms rather than always
enabling it and requiring users of MK_LIB32 to filter based
TARGET/MACHINE_ARCH.

The net effect of this change is to make Makefile.libcompat only build
compatability libraries.

Changes relative to r354449:

Correct detection of the compiler type when bsd.compat.mk is used
outside Makefile.libcompat.  Previously it always matched the clang
case.

Set LDFLAGS including the linker emulation for mips where -m32 seems to
be insufficent.

Reviewed by:	imp, kib (origional version in r354449)
Obtained from:	CheriBSD (conceptually)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D22251
2019-11-07 22:58:10 +00:00
Gleb Smirnoff
273b2e4c55 Remove now unused INP_INFO_RLOCK macros. 2019-11-07 22:26:54 +00:00
Andriy Gapon
e688e78187 revert r354482, checking for XENHVM was a wrong way of checking for Xen 2019-11-07 21:43:31 +00:00
Kyle Evans
63f34d0109 bcm_lintc: don't attach if "interrupt-controller" is missing
This is a standard required property for interrupt controllers, and present
on the bcm_lintc nodes for currently supported RPi models. For the RPi4, we
have both bcm_lintc as well as GIC-400, but only one may be active at a
time.

Don't probe bcm_lintc if it's missing the "interrupt-controller" property --
in RPi 4 DTS, the bcm_lintc node is actually missing this along with other
required interrupt properties. Presumably, if the earlier boot stages will
support switching to the legacy interrupt controller (as is suggested
possible by the documentation), the DTS will need to be updated to indicate
the proper interrupt-parent and hopefully also mark this node as an
interrupt-controller instead.
2019-11-07 21:31:15 +00:00
Gleb Smirnoff
43e8b279b8 In TCP HPTS enter the epoch in tcp_hpts_thread() and assert it in
the leaf functions.
2019-11-07 21:30:27 +00:00
Gleb Smirnoff
aed553598d Mechanically convert INP_INFO_RLOCK() to NET_EPOCH_ENTER() in TCP
timewait manipulation leaf functions.
2019-11-07 21:29:38 +00:00
Gleb Smirnoff
a81e3ecf46 Since pfslowtimo() runs in the network epoch, tcp_slowtimo()
also does.  This allows to simplify tcp_tw_2msl_scan() and
always require the network epoch in it.
2019-11-07 21:28:46 +00:00
Gleb Smirnoff
032677ceb5 Now that there is no R/W lock on PCB list the pcblist sysctls
handlers can be greatly simplified.  All the previous double
cycling and complex locking was added to avoid these functions
holding global PCB locks for extended period of time, preventing
addition of new entries.
2019-11-07 21:27:32 +00:00
Gleb Smirnoff
d40c0d47cd Now that all of the tcp_input() and all its branches are executed
in the network epoch, we can greatly simplify synchronization.
Remove all unneccesary epoch enters hidden under INP_INFO_RLOCK macro.
Remove some unneccesary assertions and convert necessary ones into the
NET_EPOCH_ASSERT macro.
2019-11-07 21:23:07 +00:00
Andriy Gapon
bff7f83d39 IPI_TRACE is not really supported on xen
x86 stack_save_td_running() can work safely only if IPI_TRACE is a
non-maskable interrupt.  But at the moment FreeBSD/Xen does not provide
support for the NMI delivery mode.  So, mark the functionality as
unsupported similarly to other platforms without NMI.
Maybe there is a way to provide a Xen-specific working
stack_save_td_running(), but I couldn't figure it out.

MFC after:	3 weeks
Sponsored by:	Panzura
2019-11-07 21:14:59 +00:00
Gleb Smirnoff
80577e5583 Remove unnecessary recursive epoch enter via INP_INFO_RLOCK
macro in udp_input().  It shall always run in the network epoch.
2019-11-07 21:08:49 +00:00
Gleb Smirnoff
5015a05f0b Remove now unused INP_HASH_RLOCK() macros. 2019-11-07 21:03:15 +00:00