Commit Graph

245943 Commits

Author SHA1 Message Date
Emmanuel Vadot
f3dbece807 libpmc: Forgot regex.h
Reported by:	ci
MFC after:	1 week
X-MFC-With:	r354549
2019-11-08 17:27:20 +00:00
Emmanuel Vadot
a0ac5706af libpmc: Match on the cpuid with a regex
The CPUID is, or can be, a regex to be matched.
Use regex from libc instead of strcmp

Tested-by:	gallatin
MFC after:	1 week
2019-11-08 16:56:48 +00:00
Eric van Gyzen
854e90da4e vmm: pass M_WAITOK to uma_zalloc when allocating FPU save area
Submitted by:	patrick.sullivan3@dell.com
Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D22276
2019-11-08 16:30:55 +00:00
Ed Maste
a3b299f0cf mark LLVM_LIBUNWIND as broken on sparc64, with PR reference
PR:		233405
2019-11-08 15:20:19 +00:00
Ed Maste
4133f23624 elfcopy/strip: Ensure sections have required alignment on output
Object files may specify insufficient alignment on certain sections, for
example due to a bug in NASM[1].  When we detect that case in elfcopy or
strip, emit a warning and increase the alignment to the minimum
required.

The NASM bug was fixed in 2015[2], but we might as well have this fixup
(and warning) in elfcopy in case we encounter such a file for any other
reason.

This might be reworked somewhat upstream - see ELF Tool Chain
ticket 485[3].

[1] https://bugzilla.nasm.us/show_bug.cgi?id=3392307
[2] 1f0cb0f2c1
[3] https://sourceforge.net/p/elftoolchain/tickets/485/

PR:		198611
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2292
2019-11-08 14:59:41 +00:00
Ed Maste
9dc7ed6253 kvm: fix types for cross-debugging
As with other libkvm interfaces use maximum-sized types to support
cross-debugging (e.g. a 64-bit vmcore on a 32-bit host).  See
https://lists.freebsd.org/pipermail/svn-src-all/2019-February/176051.html
for further discussion.

This is an API-breaking change, but there are few consumers of this
interface today.

Reviewed by:	will
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21945
2019-11-08 14:51:09 +00:00
Bjoern A. Zeeb
c1131de6f1 frag6: properly handle atomic fragments according to RFCs.
RFC 8200 says:
	"If the fragment is a whole datagram (that is, both the Fragment
         Offset field and the M flag are zero), then it does not need
         any further reassembly and should be processed as a fully
         reassembled packet (i.e., updating Next Header, adjust Payload
         Length, removing the Fragment header, etc.).  .."

That means we should remove the fragment header and make all the adjustments
rather than just skipping over the fragment header.  The difference should
be noticeable in that a properly handled atomic fragment triggering an ICMPv6
message at an upper layer (e.g. dest unreach, unreachable port) will not
include the fragment header.

Update the test cases to also test for an unfragmentable part.  That is
needed so that the next header is properly updated (not just lengths).

MFC after:	3 weeks
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D22155
2019-11-08 14:36:44 +00:00
Kyle Evans
20cb0deaa2 csu: Fix dynamiclib/init_test:jcr_test on !HAVE_CTORS archs
.jcr still needs a 0-entry added in crtend, even on !HAVE_CTORS archs, as
we're still getting .jcr sections added -- presumably due to the reference
in crtbegin. Without this terminal, the .jcr section (without data) overlaps
with the next section and register_classes in crtbegin will be examining the
wrong item.

PR:		241439
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D22132
2019-11-08 14:28:39 +00:00
Ed Maste
de15a85eb0 add reference to PR for sparc64 BSD_CRTBEGIN in BROKEN_OPTIONS
We will soon remove the BSD_CRTBEGIN option (and will use the new CRT
files always) as part of the GCC 4.2.1 removal.  Right now BSD_CRTBEGIN
works everywhere but sparc64; add a reference to the PR in case anyone
stumbles across this and is looking for more information.
2019-11-08 14:25:26 +00:00
Ed Maste
60247c8ffd arm linuxulator: reformat syscalls.master per current style
Equivalent to r339958 for sys/kern/syscalls.master.

Also add a dummy name for an UNUSED.

Sponsored by:	The FreeBSD Foundation
2019-11-08 14:18:16 +00:00
Ed Maste
b6bb45f24b arm linuxulator: add syscalls definition
From Linux arch/arm/kernel/call.S

Reviewed by:	imp (earlier)
Submitted by:	Grégory Soutadé <soutade_gmail.com>
Differential Revision:	https://reviews.freebsd.org/D7972
2019-11-08 14:17:25 +00:00
Ed Maste
d9aee13f6f makefs: avoid warning when creating FAT filesystem on existing file
Previously the mkfs_msdos function (from newfs_msdos) emitted warnings
in the case that an image size is specified and the target is not a
file, or no size is specified and the target is not a character device.
The latter warning (not a character device) doesn't make sense when this
code is used in makefs, regardless of whether an image size is specified
or not.

Sponsored by:	The FreeBSD Foundation
2019-11-08 14:11:25 +00:00
Ed Maste
c723af1169 suggest xtoolchain package if binutils and GCC bootstraps are both broken
Previously we checked for only BINUTILS_BOOTSTRAP as a broken option
and suggested installing the binutils package.  This was originally done
for arm64 where we used the in-tree Clang with external binutils package.

Add a case to the warning to suggest instead the full xtoolchain package
if we have no in-tree compiler either.

Differential Revision:	https://reviews.freebsd.org/D21851
2019-11-08 14:06:48 +00:00
Toomas Soome
1113c41fef cstyle cleanup for i386_copy.c
No functional changes are intended.
2019-11-08 12:19:03 +00:00
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