Commit Graph

124793 Commits

Author SHA1 Message Date
Andrew Rybchenko
36641d2b9d 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
2018-11-27 12:59:43 +00:00
Andrew Rybchenko
1c057dc083 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
2018-11-27 12:59:32 +00:00
Andrew Rybchenko
b1fc8575b5 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
2018-11-27 12:59:21 +00:00
Andrew Rybchenko
b20c54ffe6 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
2018-11-27 12:59:09 +00:00
Andrew Rybchenko
f2f1499740 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
2018-11-27 12:58:52 +00:00
Marius Strobl
f993117205 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().
2018-11-27 12:35:51 +00:00
Andrew Rybchenko
4effeb9e7b 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
2018-11-27 12:23:01 +00:00
Andrew Rybchenko
8da3f86b16 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
2018-11-27 12:22:50 +00:00
Andrew Rybchenko
c63c836960 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
2018-11-27 12:22:37 +00:00
Andrew Rybchenko
bbefcb4c11 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
2018-11-27 12:22:25 +00:00
Andrew Rybchenko
77226f8941 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
2018-11-27 12:22:14 +00:00
Andrew Rybchenko
df0385e554 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
2018-11-27 12:22:03 +00:00
Andrew Rybchenko
d5f7db3790 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
2018-11-27 12:21:53 +00:00
Andrew Rybchenko
824c97ed5c 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
2018-11-27 12:21:41 +00:00
Andrew Rybchenko
20c5aab398 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
2018-11-27 12:21:30 +00:00
Andrew Rybchenko
34352ef8c3 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
2018-11-27 12:21:19 +00:00
Andrew Rybchenko
10d4c14d98 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
2018-11-27 12:21:08 +00:00
Andrew Rybchenko
eecf8d281f 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
2018-11-27 12:20:57 +00:00
Andrew Rybchenko
cbc3f94f08 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
2018-11-27 12:20:46 +00:00
Andrew Rybchenko
1bef83ea41 sfxge(4): add Medford2 support to INTR module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18147
2018-11-27 12:20:35 +00:00
Andrew Rybchenko
d6f0fbb15b sfxge(4): add Medford2 support to FILTER module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18146
2018-11-27 12:20:23 +00:00
Andrew Rybchenko
5095efd4f5 sfxge(4): add Medford2 support to EV module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18145
2018-11-27 12:20:12 +00:00
Andrew Rybchenko
45becd7603 sfxge(4): move RxDP config get to EF10 NIC code
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18144
2018-11-27 12:20:01 +00:00
Andrew Rybchenko
4f58306ca6 sfxge(4): correct PIO buffer dimensions for Medford2
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18143
2018-11-27 12:19:49 +00:00
Andrew Rybchenko
ae64ac9336 sfxge(4): add Medford2 support to NIC module
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18142
2018-11-27 12:14:16 +00:00
Andrew Rybchenko
553455ea93 sfxge(4): put Siena-specific code under its efsys option
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18141
2018-11-27 12:14:05 +00:00
Andrew Rybchenko
97ce60b7d6 sfxge(4): add efsys option for Medford2
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18140
2018-11-27 12:13:54 +00:00
Andrew Rybchenko
e995da72bb sfxge(4): add Medford2 PCI IDs
Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18139
2018-11-27 12:13:39 +00:00
Marius Strobl
b34bb3bf03 - Add a belated UPDATING entry for the ixlv(4) -> iavf(4) rename in r339338.
- Likewise, add ixlv.4.gz to OLD_FILES,
- and link if_ixlv.ko to if_iavf.ko in order to aid a bit in the transition.
2018-11-27 12:11:16 +00:00
Andrey V. Elsukov
a716ad4a35 Fix possible panic during ifnet detach in rtsock.
The panic can happen, when some application does dump of routing table
using sysctl interface. To prevent this, set IFF_DYING flag in
if_detach_internal() function, when ifnet under lock is removed from
the chain. In sysctl_rtsock() take IFNET_RLOCK_NOSLEEP() to prevent
ifnet detach during routes enumeration. In case, if some interface was
detached in the time before we take the lock, add the check, that ifnet
is not DYING. This prevents access to memory that could be freed after
ifnet is unlinked.

PR:		227720, 230498, 233306
Reviewed by:	bz, eugen
MFC after:	1 week
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D18338
2018-11-27 09:04:06 +00:00
Eugene Grosbein
f8edc37316 ng_source(4): correction after the change r340617
tv_usec has "long" type for all architecture in FreeBSD
and follows __LP64__. However, this is not true for tv_sec
that has "time_t" type.

Since r320347 that changed time_t from 32 to 64 bit integer
for 32 bit version of powerpc architecture, we have only single
i386 architecture having 32 bit time_t type.

Submitted by:	jhb
MFC after:	1 week.
2018-11-27 04:05:38 +00:00
Warner Losh
d900ade516 NVME trim clocking
Add the ability to set two goals for trims in the I/O scheduler. The
first goal is the number of BIO_DELETEs to accumulate
(kern.cam.XX.U.trim_goal). When non-zero, this many trims will be
accumulated before we start to transfer them to lower layers. This is
useful for devices that like to get lots of trims all at once in one
transaction (not all devices are like this, and some vary by workload).

The second is a number of ticks to defer trims. If you've set a trim
goal, then kern.cam.XX.U.trim_ticks controls how long the system will
defer those trims before timing out and sending them anyway. It has no
effect when trim_goal is 0.

In any event, a BIO_FLUSH will cause all the TRIMs to be released to
the periph drivers. This may be a minor overloading of what BIO_FLUSH
is supposed to mean, but it's useful to preserve other ordering
semantics that users of BIO_FLUSH reply on.

Sponsored by: Netflix, Inc
2018-11-27 00:36:35 +00:00
Warner Losh
1759fd7798 Minor tweaks to the formatting
Tweak the format of the trim + read bias code. Add similar debug to
the read + writes case.

Spondored by: Netflix
2018-11-26 22:50:30 +00:00
Mark Murray
70bfe7f7a8 Add dependency to allow if_muge device to be only ethernet device in stripped-down RPI3 kernel. 2018-11-26 22:45:58 +00:00
Mark Johnston
423700997b Check for an allocation failure before dereferencing the pointer.
Reported by:	Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by:	np
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18310
2018-11-26 22:42:52 +00:00
Eric van Gyzen
607a0eb2f1 Remove superfluous bzero in getcontext/swapcontext/sendsig
We zero the whole structure; we don't need to zero the __spare__ field again.

Remove trailing whitespace.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2018-11-26 20:56:05 +00:00
Eric van Gyzen
4d5a108409 Prevent kernel stack disclosure in signal delivery
On arm64 and riscv platforms, sendsig() failed to zero the signal
frame before copying it out to userspace.  Zero it.

On arm, I believe all the contents of the frame were initialized,
so there was no disclosure.  However, explicitly zero the whole frame
because that fact could inadvertently change in the future,
it's more clear to the reader, and I could be wrong in the first place.

MFC after:	2 days
Security:	similar to FreeBSD-EN-18:12.mem and CVE-2018-17155
Sponsored by:	Dell EMC Isilon
2018-11-26 20:52:53 +00:00
Eric van Gyzen
f5e7d8bdb5 Prevent kernel stack disclosure in getcontext/swapcontext
Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc.

MFC after:	2 days
Security:	FreeBSD-EN-18:12.mem
Security:	CVE-2018-17155
Sponsored by:	Dell EMC Isilon
2018-11-26 20:50:55 +00:00
Ben Widawsky
ec60b7f929 acpi/ec: Fix regression caused by r340644
After r340644 there were two things wrong in cases where there is both
an ECDT, and an EC device exposed via acpica. The first is a rather
trivial situation where the device desc would say ECDT even when it was
not implicitly created via ECDT (not really sure why the compiler
doesn't seem to warn about this).

The other more pervasive issue is that the code is designed to
essentially not do anything for EC probe when its uid was already
created an EC based on the ECDT's uid. The issue was that probe would
still return 0 in this case, and so we'd end up with some weird
duplication. Now to be honest, I'm not actually sure what exactly broke,
but it was definitely not working as intended. To fix this, all that is
really needed is to make sure we return ENXIO when we're probing the
device already added for the ECDT entry. While here though, move the
check for this earlier to avoid wasted cycles when we know after
obtaining the uid that it's duplicative.

There remains one questionable bit here which I don't want to touch -
when doing probe for PNP0C09, if acquiring _UID for the device fails, 0
is assumed, which is a valid UID used by the implicit ECDT.

Reported by:	Charlie Li, et al.
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D18311
2018-11-26 19:41:13 +00:00
Emmanuel Vadot
3cb36739ce regulator_fixed: Do not disable fixed regulator at probe
If the regulator is unused it will be disabled by the regulator_shutdown sysinit.

Tested on pinebook where the backlight is controlled by a fixed-regulator.
The regulator doesn't have a regulator-boot-on param (I'm gonna upstream this) and so we disable it at probe.
We later enable it but this cause the screen to go black.
Linux doesn't disable regulator at boot (at least for fixed-regulator) so better match this to have the same UX.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D17978
2018-11-26 18:46:15 +00:00
Alan Somers
72bce9fff6 vfs_aio.c: rename "physio" symbols to "bio".
aio has two paths: an asynchronous "physio" path and a synchronous path.
Confusingly, physio(9) isn't actually used by the "physio" path, and never
has been.  In fact, it may even be called by the synchronous path!  Rename
the "physio" path to the "bio" path to reflect what it actually does:
directly compose BIOs and send them to character devices.

MFC after:	2 weeks
2018-11-26 18:31:00 +00:00
Emmanuel Vadot
6bff96c117 arm64: Add evdev support to GENERIC 2018-11-26 17:59:25 +00:00
Emmanuel Vadot
198e1deb5f aw_usbphy: Do not error if it's not phy 0
Only phy0 can switch between host/otg, do not error if we request
host mode on phy != 0.

MFC after:	1 month
X-MFC with:	r340846
2018-11-26 14:27:13 +00:00
Mark Johnston
d25f8522be Plug routing sysctl leaks.
Various structures exported by sysctl_rtsock() contain padding fields
which were not being zeroed.

Reported by:	Thomas Barabosch, Fraunhofer FKIE
Reviewed by:	ae
MFC after:	3 days
Security:	kernel memory disclosure
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D18333
2018-11-26 13:42:18 +00:00
Andrew Rybchenko
acc84f29fe sfxge(4): add 3.3V and 12.0V current sensors
Automatically generated using mkconfig.py.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18138
2018-11-26 07:42:52 +00:00
Andrew Rybchenko
9ed106d0b4 sfxge(4): update autogenerated headers from firmwaresrc
Pick up Medford2 interfaces.

Split AOE operations out into own header.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18137
2018-11-26 07:23:02 +00:00
Andrew Rybchenko
208539a4f7 sfxge(4): regenerate files with genfwdef after ID update
Add security level to image boot header.

Submitted by:   Andrew Jackson <ajackson at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18289
2018-11-26 07:15:19 +00:00
Andrew Rybchenko
fdbe38cf9d sfxge(4): add API to control UDP tunnel ports
HW needs to know which UDP packets should be treated as tunnel
encapsulation to do inner packet recognition, classification and
offloads.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18134
2018-11-26 06:20:13 +00:00
Kirk McKusick
a02bd3e38c Move the check for the filesystem having been run on a kernel that
predates metadata check hashes so that it is done before deciding
whether to compute a check-hash of the superblock.

Reported by:  Rick Macklem <rmacklem@uoguelph.ca>
Sponsored by: Netflix
2018-11-26 00:58:07 +00:00
Vladimir Kondratyev
a0e9218c01 evdev: Fix pause key release event in AT keyboard set 1 to evdev xlat-or.
MFC after:	2 weeks
2018-11-25 19:37:00 +00:00