Commit Graph

115277 Commits

Author SHA1 Message Date
Konstantin Belousov
57f6622f92 For i386, remove config options CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE
and device npx.

This means that FPU is always initialized and handled when available,
and SSE+ register file and exception are handled when available.  This
makes the kernel FPU code much easier to maintain by the cost of
slight bloat for CPUs older than 25 years.

CPU_DISABLE_CMPXCHG outlived its usefulness, see the removed comment
explaining the original purpose.

Suggested by and discussed with:	bde
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2017-02-03 12:51:40 +00:00
Andrew Turner
c1a2c9314f Remove an old use of _ARM_ARCH_6, we are moving to using the standard
__ARM_ARCH >= 6 spelling.

Sponsored by:	ABT Systems Ltd
2017-02-03 11:47:57 +00:00
Andrew Turner
aa7dd0fb0e Only define atomic_fcmpset_long in the kernel. We may include
machine/atomic.h in userspace, however atomic_fcmpset_32 is unimplemented
there.

Sponsored by:	ABT Systems Ltd
2017-02-03 10:04:17 +00:00
Adrian Chadd
ce4552cd1a [net80211] don't update quiet time counter values every probe request.
The quiet time counter update is happening each time the IE is added,
which also means it happens for each quiet time IE addition to the probe
response.

Only update the countdown if we request ie (ie, beacon updates.)
2017-02-03 06:04:06 +00:00
Adrian Chadd
ea319c839b [ath_hal] [ar9300] link in the CAC enable/diable methods and expose it via the HAL. 2017-02-03 05:15:35 +00:00
Adrian Chadd
2bc158cf24 [ath_hal] prepare for CAC quiet time.
To support DFS, the NIC needs to be very quiet during this time.
No transmissions including ACKs are allowed.

This is just the initial HAL glue.
2017-02-03 05:15:08 +00:00
Adrian Chadd
c15fdc23c7 [ath_hal] [ar9300] initial radar decode for AR9380 and later chips. 2017-02-03 03:57:06 +00:00
Mark Johnston
b3b5bfeb22 Sync the x86 dis_tables.c with upstream.
This corresponds to the following illumos issues:

  5755 want support for Intel FMA instrs
  5756 want support for Intel BMI1 instrs
  5757 want support for Intel BMI2 instrs
  5758 want support for Intel AVX2 instrs
  7204 Want broadwell rdseed and adx support
  7208 Want stac/clac disasm support
  7733 Need SHA Instruction dis support
  7756 dis can't handle x86 SSE 3 instructions
  7757 want avx2 disasm tests
  7758 want SSE 4.1 disasm tests

MFC after:	2 weeks
2017-02-03 03:22:47 +00:00
Warner Losh
a3a6c48d66 Ensure that the passthrough request will fit in MAXPHYS bytes after it
has been rounded to full pages. This avoids a panic in
vm_fault_quick_hold_pages due to this off-by-one error passing one
page too many into vmapbuf.
2017-02-02 23:04:06 +00:00
Konstantin Belousov
9c16356ccd Use ANSI definitions for some i386 functions.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-02-02 22:02:10 +00:00
Edward Tomasz Napierala
a6b15641d6 Ifdef out the unused vm_rr_selectdomain().
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-02-02 17:44:55 +00:00
Kurt Lidl
75429a15dd Fix compilation for mips64 platforms
The hwpmc_mips24k / hwpmc_mips74k modules are only for mips 32-bit hosts.
Reviewed by:	adrian
2017-02-02 17:43:00 +00:00
John Baldwin
2ffb582a45 Require Data Layer Active reporting for native PCI-e HotPlug.
Some PCI-e bridges report that they support HotPlug in the slot
capabilities but do not report support for Data Layer Active events
in the link capabilities register.  These bridges do not work correctly
when HotPlug is used.  Further, while the description of HotPlug in
the spec does not mention that DL active events are required, the
description of the link capabilities register says that DL active is
required for HotPlug.  Thanks to Dave Baukus for finding that language
in the spec.

PR:		211699
Submitted by:	Dave Baukus <daveb@spectralogic.com>
Reviewed by:	vangyzen
MFC after:	3 days
2017-02-02 17:29:15 +00:00
Adrian Chadd
66c73f1d0a [ath_hal] [ar9300] initial radar detection glue.
* flesh out a "get default DFS parameters" routine
* remove the stub that returns NULL
* fix up the enable DFS method to do what FreeBSD does - specifically, allow pe_enabled
  to be set/cleared.

This allows the radar pulse reporting code to function, but it doesn't yet
do anything useful.
2017-02-02 09:19:57 +00:00
Michal Meloun
93a065e749 Remake support for SMP kernel on UP cpu:
- Use new option SMP_ON_UP instead of (mis)using specific CPU type.
   By this, any SMP kernel can be compiled with SMP_ON_UP support.
 - Enable runtime detection of CPU multiprocessor extensions only
   if SMP_ON_UP option is used. In other cases (pure SMP or UP),
   statically compile only required variant.
 - Don't leak multiprocessor instructions to UP kernel.
 - Correctly handle data cache write back to point of unification.
   DCCMVAU is supported on all armv7 cpus.
 - For SMP_ON_UP kernels, detect proper TTB flags on runtime.

Differential Revision: https://reviews.freebsd.org/D9133
2017-02-02 06:14:44 +00:00
Wojciech Macek
ae0f418aa4 Remove remaining ifdefs from CESA header
Commit r312743 ("Use SoC ID - based detection in CESA") resulted
in build failing for Marvell armv5 platforms, which don't support
the newer version of CESA controller. This patch provides a fix by
removing ifdefs around bitfields' definitions, so that they are
known to all platforms.

Submitted by:          Marcin Wojtas <mw@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
2017-02-02 06:07:39 +00:00
Adrian Chadd
be34efe2f3 [ath_hal] [ar9300] initial hacks to make spectral scan working on AR9380 and later NICs.
* add debugging
* disable the manual noise floor calibration and tracking done by the HAL;
  this interferes with the normal calibration path and will lock up the RX
  side
* don't program short report / priority if they're provided as NOVAL.
2017-02-02 05:29:22 +00:00
Adrian Chadd
f59ff2a32d [ath] ensure the NIC is woken up before changing the spectral scan parameters. 2017-02-02 05:27:48 +00:00
Adrian Chadd
4a3fdd0e13 [ath_hal] add debugging level for spectral scan. 2017-02-02 05:27:27 +00:00
Adrian Chadd
38fbe19b81 [ath] add spectral scan priority. 2017-02-02 05:27:06 +00:00
Warner Losh
9b2e71ae32 Remove dangling DE425 EISA card references in the de driver. They
aren't used, and this doesn't change the supported hardware.
2017-02-02 04:50:20 +00:00
Mateusz Guzik
ed869ff019 i386: fixup fcmpset
An incorrect output specifier was used which worked with clang by accident,
but breaks with the in-tree gcc version.

While here plug a whitespace nit.

Reported by:	bde
2017-02-02 01:33:08 +00:00
Oleksandr Tymoshenko
878097c10e [am335x] Fallback to standard video interface bindings when using Linux dts
Historically AM335x LCDC driver used non-standard "hdmi" property to
refer to HDMI framer. There is no such thing in upstream DTS, so to
handle both cases fallback to bindings described in
bindings/media/video-interfaces.txt in Linux documentation.

We still make some assumptions that are not universally true: we
assume that if remote endpoint is available it's going to be HDMI
framer. Which is true for AM335x-based devices currently supported
but may be not true for some custom hardware.

MFC after:	1 week
2017-02-01 22:03:59 +00:00
Toomas Soome
151139ad9e loader: disk/part api needs to use uint64_t offsets
The disk_* and part_* api is using 64bit values for media size and
offsets. However, the current api is using off_t type, which is signed
64-bit int.

In this context the signed media size does not make any sense, and
the offsets are used to mark absolute, not relative locations.

Also, the data from GPT partition table and some other sources is
already using uint64_t data type, so using signed off_t can cause sign
issues.

Reviewed by:	imp
Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D8710
2017-02-01 20:10:56 +00:00
George V. Neville-Neil
82988b50a1 Add an mbuf to ipinfo_t translator to finish cleanup of mbuf passing to TCP probes.
Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D9401
2017-02-01 19:33:00 +00:00
Hartmut Brandt
4b481ba0ed Merge filt_soread and filt_solisten and decide what to do when checking
for EVFILT_READ at the point of the check not when the event is registers.
This fixes a problem with asio when accepting a connection.

Reviewed by:	kib@, Scott Mitchell
2017-02-01 13:12:07 +00:00
Toomas Soome
d124e3965a loader.efi environment related cleanups
Since we have dedicated libefi/env.c file for variable support, the following
changes are done:

Simple cstyle changes in env.c
Moved efi variable related commands from loader/main.c to libefi/env.c
Did create function to set "efi-version" environment variable in env.c.

This function does serve two purposes: for first a  small clean up of the
loader main(), and for second, it does replace the otherwise unused
efi_variable_support hack.
A bit of cleanup of ficl backend functions. The TEST_MAIN has no meaning,
and removed few memory leaks.

The forth code is updated to use "efi-version" variable, instead of ficl
environment check.

Reviewed by:	imp
Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D9165
2017-02-01 08:46:59 +00:00
Alexander Kabaev
2733239f37 Add atomic_fcmpset_*() inlines for MIPS
atomic_fcmpset_*() is analogous to atomic_cmpset(), but saves off the
read value from the target memory location into the 'old' pointer.

Reviewed by:	imp, brooks
Requested by:	mjg
Differential Revision:	https://reviews.freebsd.org/D9391
2017-02-01 05:00:34 +00:00
Jason A. Harmening
65ed483615 Implement get_pcpu() for the remaining architectures and use it to
replace pcpu_find(curcpu) in MI code.
2017-02-01 03:32:49 +00:00
Justin Hibbits
91722a2f0f Add Book-E Enhanced Debug (E.D) profile debug support
Freescale added the E.D profile to e500mc and derivative cores.  From
Freescale's EREF reference manual this is enabled by a bit in HID0 and should
otherwise default to traditional debug.  However, none of the Freescale cores
support that bit, and instead always use E.D.  This results in kernel panics
using the standard debug on e500mc+ cores.

Enhanced debug allows debugging of interrupts, including critical interrupts,
as it uses a different save/restore registers (srr*).  At this time we don't use
this ability, so instead share the core of the debug handler code between both
handlers.

MFC after:	3 weeks
2017-02-01 03:29:13 +00:00
Warner Losh
50d96564ed Add USB IDs supported by TI / Intel USB 3410 family (modems of various
flavors). This includes both the release products (from Honeywell,
Moxa and Multitech) as well as development kits.
2017-02-01 02:00:18 +00:00
Michael Tuexen
c03627fd06 Ensure that the variable bail is always initialized before used.
MFC after:	1 week
2017-02-01 00:10:29 +00:00
Michael Tuexen
2aa116007c Take the SCTP common header into account when computing the
space available for chunks. This unbreaks the handling of
ICMPV6 packets indicating "packet too big". It just worked
for IPv4 since we are overbooking for IPv4.

MFC after:	1 week
2017-01-31 23:36:31 +00:00
Michael Tuexen
7858d7cb8e Remove a duplicate debug statement.
MFC after:	1 week
2017-01-31 23:34:02 +00:00
Andriy Voskoboinyk
704cd54206 net80211: cleanup ic_flags / iv_flags
Flags
 - IEEE80211_F_ASCAN
 - IEEE80211_F_SIBSS
 - IEEE80211_F_IBSSON
are not used since r170530 (old WI compatibility ioctls removal)
and r178354 (removed from other places).

IEEE80211_F_TXPOW_FIXED was never utilized; initially added with
IEEE80211_F_TXPOW_AUTO / IEEE80211_F_TXPOW_OFF flags,
which were replaced with IEEE80211_C_TXPMGT capability check in r138568.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D9369
2017-01-31 22:21:08 +00:00
Adrian Chadd
39d5467677 [ath] log seqno, type and subtype when assigning sequence numbers for A-MPDU.
This is just to improve adrian-debugging.
2017-01-31 20:57:40 +00:00
John Baldwin
0ed5eff947 Fix a couple of issues with t4iov probe and attach.
- Check for Chelsio vendor ID in probe routines.
- Fail attach instead of faulting if pci_find_dbsf() doesn't find a
  device.

PR:		216539
Reported by:	asomers
Tested by:	Dave Baukus <daveb@spectralogic.com>
MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-01-31 18:54:13 +00:00
Stephen J. Kiernan
d0b2cad1ca Add the folowing set accessor functions for recently-added members of ifnet
structure:

if_gethwtsomax(), if_sethwtsomax()                 - if_hw_tsomax
if_gethwtsomaxsegcount(), if_sethwtsomaxsegcount() - if_hw_tsomaxsegcount
if_gethwtsomaxsegsize(), if_sethwtsomaxsegsize()   - if_hw_tsomaxsegsize

Update em and vnic drivers which had already been coverted to use accessor
functions for the other ifnet structure members.

Reviewed by:	erj
Approved by:	sjg (mentor)
Obtained from:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D8544
2017-01-31 16:12:31 +00:00
Edward Tomasz Napierala
b38b22b0b2 Add kern_pread() and kern_pwrite(), and use it in compats instead
of their sys_*() counterparts. The svr4 is left unchanged.

Reviewed by:	kib@
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D9379
2017-01-31 15:35:18 +00:00
Edward Tomasz Napierala
5db72ef2e4 Fix linux_getppid() to debug the actual parent, even it was reparented
by debugger.

Reviewed by:	dchagin@
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D9361
2017-01-31 15:22:51 +00:00
Edward Tomasz Napierala
fc8bde8ffe Replace calls to sys_truncate() with kern_truncate().
Reviewed by:	kib@
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D9371
2017-01-31 15:19:44 +00:00
Edward Tomasz Napierala
ea2ebdc19e Add kern_cpuset_getid() and kern_cpuset_setid(), and use them
in compat32 instead of their sub_*() counterparts.

Reviewed by:	jhb@, kib@
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D9382
2017-01-31 15:11:23 +00:00
Jared McNeill
265c594a2c Add missing ephy bus gates and resets. 2017-01-31 14:36:06 +00:00
Justin Hibbits
d3a8234cef Don't retry a lost reservation in atomic_fcmpset()
The desired behavior of atomic_fcmpset_() is to always exit on error.  Instead
of retrying on lost reservation, leave the retry to the caller, and return
error.

Reported by:	kib
2017-01-31 03:40:13 +00:00
Conrad Meyer
6be2ff7d3e calculate_crc32c: Add SSE4.2 implementation on x86
Derived from an implementation by Mark Adler.

The fast loop performs three simultaneous CRCs over subsets of the data
before composing them.  This takes advantage of certain properties of
the CRC32 implementation in Intel hardware.  (The CRC instruction takes 1
cycle but has 2-3 cycles of latency.)

The CRC32 instruction does not manipulate FPU state.

i386 does not have the crc32q instruction, so avoid it there.  Otherwise
the implementation is identical to amd64.

Add basic userland tests to verify correctness on a variety of inputs.

PR:		216467
Reported by:	Ben RUBSON <ben.rubson at gmail.com>
Reviewed by:	kib@, markj@ (earlier version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D9342
2017-01-31 03:26:32 +00:00
Justin Hibbits
d9dbd70bca Update CFLAGS for clang compatibility
* Clang/llvm does not (yet) support -m(no-)spe, so make it gcc-only
* Clang now supports -msoft-float, and does not appear to recognize
  "-disable-ppc-float-in-variadic", which appears to have been a crutch until
  soft-float was implemented.  It's now implemented for both 32- and 64-bit.
* Clang/llvm use a 'medium' code model by default for powerpc64, supporting up
  to 4GB TOC, and does not support the '-mminimal-toc' option.  Given both of
  these, make -mminimal-toc gcc-only.

MFC after:	2 weeks
2017-01-31 01:55:29 +00:00
Adrian Chadd
cc59dd9ae0 Fix compilation! 2017-01-31 01:48:55 +00:00
Gleb Smirnoff
164aa3ce5e Fix indentantion in pf_purge_thread(). No functional change. 2017-01-30 22:47:48 +00:00
Adrian Chadd
4691c88fee [mips] add some (temporary, I hope!) mips24k/mips74k hwpmc modules.
Ideally we'd have a top level hwpmc module with the shared bits, then
cpu specific glue as needed.  However, on the MIPS side, there's no
probe code - {mips24k, mips74k, octeon} implement a set of methods
that hwpmc_mips.c expects.

So this populates separate modules with duplicate code.
Ew, but it does work.

This gets me off the hook - these work fine as copied into the relevant
mfsroot for mips24k/mips74k systems.

TODO:

* do it the "right" way in the future.  Note that modules/hwpmc/ does
  build fine on MIPS, it jusn't DO anything.  So it'd be nice to
  maybe call that "hwpmc_core" and then "hwpmc" can be the CPU/arch glue.
2017-01-30 22:29:21 +00:00
Alan Somers
4e02badb18 Initialize a stack variable in mprsas_get_sas_address_for_sata_disk
Thought it's difficult to reproduce, I think this variable was responsible
for a use-after-free panic when a SATA disk timed out responding to a SATA
identify command during boot.

Submitted by:	slm
Reviewed by:	slm
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9364
2017-01-30 19:49:08 +00:00