Commit Graph

220268 Commits

Author SHA1 Message Date
Warner Losh
f2e8ba3f76 Remove EISA support for ep driver. Left in place EISA strings that are
still relevant (ISA cards can still be in EISA mode, and we're still
ignoring those in the identify routine). Notes about cards in EISA
mode have been left in the manual since they aren't relevant to EISA
support, but instruct how to properly configure an ISA card in a mode
when it is in a ISA bus slot.
2017-02-16 21:56:51 +00:00
Warner Losh
222dc69183 Remove references to EISA support from the vx driver, along with EISA
support. Fix a comment block that's shared with both vx and ep. Remove
obsolete refernce to statically compiling a kernel with a fixed number
of vx devices. Have not removed EISA from the title of the document
the register definitions were originally derived from (though no doubt
more recent docments were also consulted).
2017-02-16 21:56:46 +00:00
Warner Losh
1697447ec0 Remove references to C-Bus support in the le(4) driver. Support for
these devices were removed when pc98 was removed.
2017-02-16 21:56:41 +00:00
Warner Losh
62942cfb95 Remove stray reference to EISA bus support that was never in FreeBSD. 2017-02-16 21:56:36 +00:00
Warner Losh
572f2440a8 Remove references to EISA support in mlx. The driver never supported
the EISA cards and EISA bus support is being removed.
2017-02-16 21:56:32 +00:00
Warner Losh
d4bfe93950 Remove the ahb driver for the EISA Adaptec 174x. 2017-02-16 21:56:27 +00:00
Warner Losh
596c88eeb8 Remove stale MCA comment now that the MCA bus support is gone.
Relnotes: yes
2017-02-16 21:56:21 +00:00
Ryan Stone
27ee18ad33 Revert r313814 and r313816
Something evidently got mangled in my git tree in between testing and
review, as an old and broken version of the patch was apparently submitted
to svn.  Revert this while I work out what went wrong.

Reported by:	tuexen
Pointy hat to:	rstone
2017-02-16 21:18:31 +00:00
Dimitry Andric
b0f512390e Pull in r285478 from upstream compiler-rt trunk (by Saleem Abdulrasool):
build: give aliases the same visibility

  ARM EABI also uses function aliases.  Ensure that those aliased
  functions are given proper visibility annotations.

Reported by:	mmel
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9633
2017-02-16 21:03:43 +00:00
Eric van Gyzen
922193e7ff Remove inet_ntoa() from the kernel
inet_ntoa() cannot be used safely in a multithreaded environment
because it uses a static local buffer.  Remove it from the kernel.

Suggested by:	glebius, emaste
Reviewed by:	gnn
MFC after:	never
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D9625
2017-02-16 20:50:01 +00:00
Eric van Gyzen
8144690af4 Use inet_ntoa_r() instead of inet_ntoa() throughout the kernel
inet_ntoa() cannot be used safely in a multithreaded environment
because it uses a static local buffer. Instead, use inet_ntoa_r()
with a buffer on the caller's stack.

Suggested by:	glebius, emaste
Reviewed by:	gnn
MFC after:	2 weeks
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D9625
2017-02-16 20:47:41 +00:00
Eric van Gyzen
643faabe0d pf: use inet_ntoa_r() instead of inet_ntoa(); maybe fix IPv6 OS fingerprinting
inet_ntoa() cannot be used safely in a multithreaded environment
because it uses a static local buffer. Instead, use inet_ntoa_r()
with a buffer on the caller's stack.

This code had an INET6 conditional before this commit, but opt_inet6.h
was not included, so INET6 was never defined.  Apparently, pf's OS
fingerprinting hasn't worked with IPv6 for quite some time.
This commit might fix it, but I didn't test that.

Reviewed by:	gnn, kp
MFC after:	2 weeks
Relnotes:	yes (if I/someone can test pf OS fingerprinting with IPv6)
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D9625
2017-02-16 20:44:44 +00:00
Pedro F. Giffuni
10723054ce Remove outdated claim.
Despite wishful thinking the removal of these old function hasn't
happened yet.

MFC after:	3 days
2017-02-16 20:30:55 +00:00
Pedro F. Giffuni
4eecef9062 Small inclusion guard comment fix. 2017-02-16 20:28:30 +00:00
Eric van Gyzen
2fce775ec6 acpica: remove a superfluous NULL check
The address-of operator can't produce NULL (in practice).
Remove an unnecessary NULL check.

MFC after:	3 days
Sponsored by:	Dell EMC
2017-02-16 20:27:22 +00:00
Ryan Stone
3600f4ba35 Fix a typo in my previous commit
Somehow in the late stages of testing my sched_ule patch, a character was
accidentally deleted from the file.  Correct this.

While I'm committing anyway, the previous commit message requires some
clarification: in the normal case of unlending priority after releasing
a mutex, the thread that was doing the lending will be woken up and
immediately become the highest-priority thread, and in that case no
priority inversion would take place.  However, if that thread is pinned
to a different CPU, then the currently running thread that just had its
priority lowered will not be preempted and then priority inversion can
occur.

Reported by:	O. Hartmann (typo), jhb (scheduler clarification)
MFC after:	1 month
Pointy hat to:	rstone
2017-02-16 20:06:21 +00:00
Bartek Rutkowski
955255728c Add 0-8 as shortcuts for jumping to menu items in the hardening menu.
Submitted by:	skreuzer
Reviewed by:	allanjude, robak
Approved by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D6826
2017-02-16 19:58:02 +00:00
Ryan Stone
09ae7c4814 Check for preemption after lowering a thread's priority
When a high-priority thread is waiting for a mutex held by a
low-priority thread, it temporarily lends its priority to the
low-priority thread to prevent priority inversion.  When the mutex
is released, the lent priority is revoked and the low-priority
thread goes back to its original priority.

When the priority of that thread is lowered (through a call to
sched_priority()), the schedule was not checking whether
there is now a high-priority thread in the run queue.  This can
cause threads with real-time priority to be starved in the run
queue while the low-priority thread finishes its quantum.

Fix this by explicitly checking whether preemption is necessary
when a thread's priority is lowered.

Sponsored by: Dell EMC Isilon
Obtained from: Sandvine Inc
Differential Revision:	https://reviews.freebsd.org/D9518
Reviewed by: Jeff Roberson (ule)
MFC after: 1 month
2017-02-16 19:41:13 +00:00
Josh Paetzel
c53cc7187c MFV 313786
7500 Simplify dbuf_free_range by removing dn_unlisted_l0_blkid

illumos/illumos-gate@653af1b809
653af1b809

https://www.illumos.org/issues/7500
  With the integration of:

    commit 0f6d88aded0d165f5954688a9b13bac76c38da84
    Author: Alex Reece <alex@delphix.com>
    Date:   Sat Jul 26 13:40:04 2014 -0800
    4873 zvol unmap calls can take a very long time for larger datasets

  the dnode's dn_bufs field was changed from a list to a tree. As a result,
  the dn_unlisted_l0_blkid field is no longer necessary.

Author: Stephen Blinick <stephen.blinick@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
2017-02-16 19:00:09 +00:00
Hans Petter Selasky
ddad2785bc Allow container_of() to be used with constant data pointers.
Obtained from:		kmacy @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-16 14:13:36 +00:00
Edward Tomasz Napierala
d82de05480 Implement linux version of ptrace(2). It's nowhere near complete,
but it allows to use 64 bit linux strace(1) on 64 bit linux binaries.

Reviewed by:	dchagin (earlier version)
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D9406
2017-02-16 13:32:15 +00:00
Hans Petter Selasky
622f2291e8 Implement more LinuxKPI atomic functions and macros.
Obtained from:		kmacy @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-16 12:56:10 +00:00
Hans Petter Selasky
28a04a26b2 Allow passing a constant atomic_t to atomic_read().
Obtained from:		kmacy @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-16 12:20:57 +00:00
Hans Petter Selasky
13459eb4a3 Whitespace fix.
Obtained from:		kmacy @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-16 12:08:52 +00:00
Andrey V. Elsukov
ddc9f8e87f Fix LINT build for powerpc.
Build kernel modules support only when both IPSEC and TCP_SIGNATURE
are not defined.

Reported by:	emaste
2017-02-16 11:38:50 +00:00
Edward Tomasz Napierala
8081c6ce6b Improve debugging output.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-02-16 10:36:00 +00:00
Ed Schouten
8eb15797b1 Remove unnecessary #includes from the kqueue(2) man page.
Now that <sys/event.h> can be included on its own, adjust the manual
page accordingly. Remove both unnecessary #include statements from the
synopsis and the example code.

While there, also add a note to the BUGS section to mention that
previous versions of this header file still depend on <sys/types.h>.

Reviewed by:	ngie, vangyzen
Differential Revision:	https://reviews.freebsd.org/D9605
2017-02-16 06:52:53 +00:00
Konstantin Belousov
bd1623def1 Do not access memory past the buffer end.
Do not accept and silently truncate too long hostname.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-02-16 06:36:16 +00:00
Konstantin Belousov
599009e261 Do not allocate char[MNAMELEN] on stack in nfsclient.
Right now this is not critical, but will be after planned increase of
MNAMELEN from 88 to 1k.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-02-16 06:34:20 +00:00
Konstantin Belousov
cdf44896bb Use uintmax_t to print st_nlink.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-02-16 06:32:39 +00:00
Konstantin Belousov
cf53034fc7 Minor style fixes.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2017-02-16 06:31:36 +00:00
Ed Maste
39cbdda0d1 makefs: use a macro to simplify per-fs function declarations
makefs.h 1.28

Obtained from:	NetBSD
2017-02-16 03:12:47 +00:00
Josh Paetzel
281825cdf1 7500 Simplify dbuf_free_range by removing dn_unlisted_l0_blkid
illumos/illumos-gate@653af1b809
653af1b809

https://www.illumos.org/issues/7500
  With the integration of:

    commit 0f6d88aded0d165f5954688a9b13bac76c38da84
    Author: Alex Reece <alex@delphix.com>
    Date:   Sat Jul 26 13:40:04 2014 -0800
    4873 zvol unmap calls can take a very long time for larger datasets

  the dnode's dn_bufs field was changed from a list to a tree. As a result,
  the dn_unlisted_l0_blkid field is no longer necessary.

Author: Stephen Blinick <stephen.blinick@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
2017-02-16 01:44:56 +00:00
Warner Losh
c21a66649f Use symbolic constants for OSC support / control negotiations.
Differential Revision: https://reviews.freebsd.org/D9604
2017-02-15 23:49:28 +00:00
Mateusz Guzik
1085c4fa53 rwlock: tidy up r313392
While a new bit was added and thread alignment got shifted to accomodate it,
RW_READERS_SHIFT was not modified accordingly and clashed with the new flag.

This was surprisingly harmless. If the lock was taken for writing, other flags
were tested. If the lock was taken for reading, it would correctly work for
readers > 1 and this was the only relevant test performed.
2017-02-15 23:33:14 +00:00
Warner Losh
5625fe9246 Remove Micro Channel Architecture support. Of the commonly available
machines, only a few 486 machines that used it, and those haven't had
enough memory to run FreeBSD for quite some time (often limited to
16MB).

Not to be confused with the Machine Check Architecture, which is still
very much alive and used (and untouched by this commit).

No Objection From: arch@
2017-02-15 23:04:25 +00:00
Martin Matuska
5d6770bd30 MFV r313781:
Sync libarchive with vendor

Vendor changes:
Make SCHILY.acl.ace header more compact (NFSv4 ACLs)

Vendor bugfixes:
zip reader integer parsing fix (OSS-Fuzz 556)
spelling fixes (issue #863)
2017-02-15 20:17:55 +00:00
Martin Matuska
b2ee1181b4 Update vendor/libarchive to git 0edabbad1f44641c64fe9d0cbaed27ed93ab38c2
Vendor changes:
Make SCHILY.acl.ace header more compact (NFSv4 ACLs)

Vendor bugfixes:
zip reader integer parsing fix (OSS-Fuzz 556)
spelling fixes (issue #863)
2017-02-15 20:00:36 +00:00
Ed Maste
1dc349ab95 prefix UFS symbols with UFS_ to reduce namespace pollution
Specifically:
  ROOTINO -> UFS_ROOTINO
  WINO -> UFS_WINO
  NXADDR -> UFS_NXADDR
  NDADDR -> UFS_NDADDR
  NIADDR -> UFS_NIADDR
  MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Also prefix ext2's and nandfs's NDADDR and NIADDR with EXT2_ and NANDFS_

Reviewed by:	kib, mckusick
Obtained from:	NetBSD
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9536
2017-02-15 19:50:26 +00:00
Alexander Motin
605703b5df Fix handling of negative sbspace() return values.
I found that at least with Chelsio NICs TOE sockets quite often report
negative sbspace() values.  Using unsigned variable to store it resulted
in attempts to aggregate too much data in one sosend() call, that caused
errors and following connection termination.

MFC after:	2 weeks
2017-02-15 19:46:00 +00:00
Hans Petter Selasky
08c6504d07 Improve code readability and fix compilation error when using clang 4.x.
Found by:		emaste @
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-02-15 18:31:09 +00:00
Ravi Pokala
07a4559495 Un-break vt(4) for {powerpc,powerpc64,sparc64} LINT kernel builds
The {powerpc,powerpc64,sparc64} LINT kernel builds fail with this error:

    sys/dev/vt/vt_buf.c:198: warning: 'vtbuf_htw' defined but not used

Move vtbuf_htw() inside the '#if SC_NO_CUTPASTE' block where it belongs, and
put it in the proper order.

This fixes the immedate issue w/ vt(4), but all three then fail on different
issues.

Reviewed by:	emaste
2017-02-15 17:33:03 +00:00
Edward Tomasz Napierala
a3b4ab9116 Change the "devfs_fsync: vop_stdfsync failed" from panic to a printf.
It's not a proper fix, but should be better than what we have now.
Since it got broken some six months ago it results in an incredibly
annoying and trivially reproducible panic every time eg an USB disk
gets disconnected.

MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-02-15 16:52:21 +00:00
Ed Maste
26ab9a178c localtime: return NULL if time_t out of range of struct tm
Previously we would truncate tm.tm_year for any time_t corresponding to
a year that does not fit in int.  This issue was discovered because it
caused the bash-static build to fail when linking with LLD.

As reported by Rafael Espíndola:

    Configure has

    AC_FUNC_MKTIME

    which expands to a test of mktime that fails with the freebsd
    implementation. Given that, bash compiles a mktime.o file that
    defines just mktime and uses localtime. That goes in a .a file
    that is before libc.

    The freebsd libc defines mktime in localtime.o, which also defines
    localtime among other functions.

    When lld sees an undefined reference to mktime from libc, it uses
    the bash provided one and then tries to find a definition of
    localtime. It is found on libc's localtime.o, but now we have a
    duplicated error.

    The reason it works with bfd is that bash doesn't use mktime
    directly and the undefined reference from libc is resolved to the
    libc implementation. It would also fail to link if bash itself
    directly used mktime.

The bash-static configure test verifies that, for many values of t, either
localtime(t) returns NULL or mktime(localtime(t)) == t.  This test failed
when localtime returned a truncated tm_year.

This was fixed in tzcode in 2004 but has persisted in our tree since
rS2708.

Reported by:	Rafael Espíndola
Reviewed by:	bapt
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9534
2017-02-15 15:32:29 +00:00
Andrew Turner
783b367605 Load the new sp_el0 with interrupts disabled in fork_trampoline. If an
interrupt arrives in fork_trampoline after sp_el0 was written we may then
switch to a new thread, enter userland so change this stack pointer, then
return to this code with the wrong value. This fixes this case by moving
the load of sp_el0 until after interrupts have been disabled.

Reported by:	Mark Millard (markmi@dsl-only.net)
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D9593
2017-02-15 14:56:47 +00:00
Roger Pau Monné
f33f887e94 bxe: enable usage with NetXtreme II BCM57840 2x20GbE chip
Current bxe probe function won't attach to devices with the NetXtreme II
BCM57840 2x20GbE chip, enable it by adding it's chip ID to the list of
supported chips.

Tested on:		HP ProLiant WS460c Gen9
Reviewed by:		gnn
MFC after:		1 week
Sponsored by:		Citrix Systems R&D
Differential Revision:	https://reviews.freebsd.org/D9609
2017-02-15 14:34:40 +00:00
Edward Tomasz Napierala
c6639ffe4e Regen after r313769.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-02-15 14:25:50 +00:00
Edward Tomasz Napierala
4ac1825ce3 Fix definition of linux64 ptrace syscall.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-02-15 14:12:39 +00:00
Andrew Turner
9c6d6488fa Port the Linux AMX 10G network driver to FreeBSD as axgbe. It is unlikely
we will import a newer version of the Linux code so the linuxkpi was not
used.

This is still missing 10G support, and multicast has not been tested.

Reviewed by:	gnn
Obtained from:	ABT Systems Ltd
Sponsored by:	SoftIron Inc
Differential Revision:	https://reviews.freebsd.org/D8549
2017-02-15 13:56:04 +00:00
Andrew Turner
44b781cfe0 Import the AMD 10G ethernet driver for the AMD Opteron A1100.
This is from Linux git as of 5eb4dce3b3471ec9d1ea2945fa3d2bab4ac7e100

Obtained from:	Linux
Sponsored by:	SoftIron Inc
2017-02-15 13:37:32 +00:00