Commit Graph

223017 Commits

Author SHA1 Message Date
Ed Maste
366e9e4538 fix sparc64 build by restoring 'register' in pcpu.h
Reported by:	jhb
Sponsored by:	The FreeBSD Foundation
2017-05-17 16:32:24 +00:00
Zbigniew Bodek
9c06c1c42a Add missing unlock in e6000sw driver
This patch adds missing unlock on attach failure.

Submitted by:  Zbigniew Bodek <zbb@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10712
2017-05-17 15:59:45 +00:00
Zbigniew Bodek
7118192a72 Fix broken malloc in e6000sw
Malloc should always return something when M_WAITOK flag is used,
but keep this code and change flag to M_NOWAIT as it is under a lock
(allows for possible future change). Free ifnet structure to avoid
memory leak on failure.

Submitted by:  Zbigniew Bodek <zbb@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10711
2017-05-17 15:58:39 +00:00
Zbigniew Bodek
b488f7aaa5 Fix registration of MPIC driver
Submitted by:  Michal Mazur <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Netgate
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10717
2017-05-17 15:57:14 +00:00
Zbigniew Bodek
da081cb51d Correct MPIC order of attachment
If MPIC happens to be a slave interrupt controller (as on Armada38x),
it should be attached after primary interrupt controller.
Thus BUS_PASS_ORDER_LATE was added to default BUS_PASS_INTERRUPT.

This change doesn't affect the cases when MPIC is standalone IC.

Submitted by:  Bartosz Szczepanek <bsz@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Stormshield, Netgate
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10715
2017-05-17 15:56:09 +00:00
Zbigniew Bodek
49b5f55902 Enable proper parsing of nested simlpe-buses on Marvell platforms
OF_finddevice doesn't find the "simple-bus" node, which is problematic
for Marvell platforms, using nested buses in Device Tree, like
Armada 38x SoC.

Submitted by: Arnaud Ysmal <arnaud.ysmal@stormshield.eu>
Obtained from: Stormshield
Sponsored by: Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10719
2017-05-17 15:54:33 +00:00
Zbigniew Bodek
dbd1638a48 Parse EHCI windows on Marvell platforms
Add missing compatibility string to allow proper
window configuration for EHCI devices.

Submitted by: Wojciech Macek <wma@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10722
2017-05-17 15:53:13 +00:00
Zbigniew Bodek
abafc55b96 Fix USB3.0 decoding windows on Armada38x
Set correct offset for MBUS windows configuration in
USB3.0 interface.

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10721
2017-05-17 15:52:04 +00:00
Luiz Otavio O Souza
a564364892 Move the IO Window Control Register defines out of the ARMADA38X ifdef.
Fixes the build of Marvell kernels (other than ARMADA38X) after r318336.

Reported by:	mmel
2017-05-17 15:13:01 +00:00
Josh Paetzel
5bcd39c054 Increase the number of LUNs this hardware can support.
Experimentally we know this value works, but the hardware
may support an even higher value.

PR:	213876
Reported by:	J.Catrysse@proximedia.be
MFC after:	1 week
2017-05-17 13:22:13 +00:00
Andrey V. Elsukov
52772a8583 Allow zero port specification in table entries with type flow.
PR:		217620
MFC after:	1 week
2017-05-17 10:56:22 +00:00
Andrey V. Elsukov
38cc96a887 Set M_BCAST and M_MCAST flags on mbuf sent via divert socket.
r290383 has changed how mbufs sent by divert socket are handled.
Previously they are always handled by slow path processing in ip_input().
Now ip_tryforward() is invoked from ip_input() before in_broadcast() check.
Since diverted packet lost all mbuf flags, it passes the broadcast check
in ip_tryforward() due to missing M_BCAST flag. In the result the broadcast
packet is forwarded to the wire instead of be consumed by network stack.

Add in_broadcast() check to the div_output() function. And restore the
M_BCAST flag if destination address is broadcast for the given network
interface.

PR:		209491
MFC after:	1 week
2017-05-17 09:04:09 +00:00
Edward Tomasz Napierala
43af586011 Bump default MAXTSIZ (kern.maxtsiz) from 128MB to 32GB. The old limit
prevents one from running eg clang built with debug; the new one is
arbitrary (equal to MAXDSIZ) and... well, should be quite future-proof.

Same fix might be applicable to other 64 bit architectures; I'll ask
their respective maintainers to make sure it won't break anything.

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10758
2017-05-17 08:38:41 +00:00
Ed Maste
3e85b721d6 Remove register keyword from sys/ and ANSIfy prototypes
A long long time ago the register keyword told the compiler to store
the corresponding variable in a CPU register, but it is not relevant
for any compiler used in the FreeBSD world today.

ANSIfy related prototypes while here.

Reviewed by:	cem, jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D10193
2017-05-17 00:34:34 +00:00
John Baldwin
00f6cd3f56 Add sglist_append_sglist().
This function permits a range of one scatter/gather list to be appended to
another sglist.  This can be used to construct a scatter/gather list that
reorders or duplicates ranges from one or more existing scatter/gather
lists.

Sponsored by:	Chelsio Communications
2017-05-16 23:31:52 +00:00
John Baldwin
720e7bb69c Add support for child devices that aren't ports.
Invoke any identify routines of child drivers during attach before attaching
children, and delete any remaining devices after deleting ports.

MFC after:	1 month
Sponsored by:	Chelsio Communications
2017-05-16 23:18:50 +00:00
John Baldwin
04794d246a Note that the first release of FreeBSD/alpha was 3.2.
Alpha is explicitly mentioned in the release announcements beginning with
3.2.
2017-05-16 23:15:40 +00:00
Jilles Tjoelker
5183ddf2ed sh: Simplify output buffering.
Similarly to how STPUTC was changed, change struct output to store the
pointer just past the end of the available space instead of the size of the
available space, so after writing a character it is only necessary to
increment a pointer and not to decrement a counter.
2017-05-16 21:54:51 +00:00
David C Somayajulu
7a377fbeb1 QL_DPRINT macro modfied to handle multiple args; print line#.
Submitted by:Shminderjit.Singh@cavium.com
MFC after:3 days
2017-05-16 21:46:30 +00:00
David C Somayajulu
77388ed2f3 1. Move Rx Processing to fp_taskqueue(). With this CPU utilization for processing interrupts drops to around 1% for 100G and under 1% for other speeds.
2. Use sysctls for TRACE_LRO_CNT and TRACE_TSO_PKT_LEN
3. remove unused mtx tx_lock
4. bind taskqueue kernel thread to the appropriate cpu core
5. when tx_ring is full, stop further transmits till at least 1/16th of the Tx Ring is empty. In our case 1K entries. Also if there are rx_pkts to process, put the taskqueue thread to sleep for 100ms, before enabling interrupts.
6. Use rx_pkt_threshold of 128.

MFC after:3 days
2017-05-16 21:34:40 +00:00
Konstantin Belousov
da403aea11 Pretend that there is some security when executing in direct mode.
Do not allow direct exec if we the process is suid. Try to follow Unix
permission checks for DACs, ignore ACLs.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D10750
2017-05-16 19:53:38 +00:00
Ed Maste
4dd362f93f newfs_msdos: clarify description of -T (timestamp) option
Submitted by:	Siva Mahadevan <smahadevan@freebsdfoundation.org>
Reported by:	Daniel Shahaf <danielsh apache org>
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2017-05-16 19:03:26 +00:00
Phil Shafer
8a6eceff3c Import libxo-0.7.2; add xo_options.7.
Submitted by:	phil
Reviewed by:	sjg
Approved by:	sjg (mentor)
2017-05-16 18:46:56 +00:00
John Baldwin
6dfb9460ca Skip tests depending on coredumps if coredumps are disabled via kern.coredump.
The kern.coredump sysctl can be set to 0 to disable coredumps.  Skip the
'status_coredump' and 'wait6_coredumped' tests if this sysctl is set to 0
rather than reporting a failure.

Submitted by:	brooks
Reviewed by:	ngie
Obtained from:	CheriBSD
Sponsored by:	DARPA / AFRL
Differential Revision:	https://reviews.freebsd.org/D10665
2017-05-16 18:42:44 +00:00
Phil Shafer
f720a75aba Import libxo 0.7.2 2017-05-16 18:41:36 +00:00
John Baldwin
047e65ec2d Fix p_endcopy.
For p_endcopy to work correctly, it must be the name of the next element
in struct proc after the end of the copy region, not the name of the
last element in the copy region.  Currently, the last element
(p_elf_flags) is not being copied.  In addition, the p_xexit and
p_xsig fields should not be copied on fork, so move them out of the
copy region.

Reviewed by:	kib
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D10677
2017-05-16 18:39:23 +00:00
Sean Bruno
1e3ab5fd4a Add version tag to the driver.
Start at version 1.0.0.0

Submitted by:	bhargava.marreddy@broadcom.com
Reviewed by:	venkatkumar.duvvuru@broadcom.com
Differential Revision:	https://reviews.freebsd.org/D10616
2017-05-16 18:05:34 +00:00
Toomas Soome
136b6a0f5f libstand: increase nfs max read size to 16k
With ip fragment reassembly implemented, it makes sense to allow
larger nfs reads. Note due to loader heap size limit, we do not want
to set too large maximum read size. Also we do not change default read size.

Reviewed by:	bcr, allanjude
Differential Revision:	https://reviews.freebsd.org/D10754
2017-05-16 17:35:05 +00:00
Ed Maste
28ef05f7c3 newfs_msdos: add -T (timestamp) option for reproducible builds
This includes some whitespace and minor bug fixes relative to NetBSD,
which will be submitted upstream at the conclusion of the makefs
msdos update.

NetBSD revs:
mkfs_msdos.c	1.11
mkfs_msdos.h	1.4
newfs_msdos.8	1.22
newfs_msdos.c	1.44

Submitted by:	Siva Mahadevan <smahadevan@freebsdfoundation.org>
Reviewed by:	emaste
Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
2017-05-16 17:04:50 +00:00
Conrad Meyer
fcf0952c80 Correct page frame mask constant used in pmap_change_attr_locked
This was introduced in r290156.  It's present in 11.0, but not any 10.x
release unless someone decided to MFC it.

It affects ordinary pages right above the DMAP limit, which is effectively
system memory rounded up to a 1 GB (3rd level superpage) boundary (or up to
a minimum of 4 GB, on small systems).

Reported by:	vangyzen
Reviewed by:	kib, alc
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D4030
2017-05-16 16:20:22 +00:00
Hans Petter Selasky
65b017b420 Avoid use of contiguous memory allocations in busdma when possible.
This patch improves the boundary checks in busdma to allow more cases
using the regular page based kernel memory allocator. Especially in
the case of having a non-zero boundary in the parent DMA tag. For
example AMD64 based platforms set the PCI DMA tag boundary to
PCI_DMA_BOUNDARY, 4GB, which before this patch caused contiguous
memory allocations to be preferred when allocating more than PAGE_SIZE
bytes. Even if the required alignment was less than PAGE_SIZE bytes.

This patch also fixes the nsegments check for using kmem_alloc_attr()
when the maximum segment size is less than PAGE_SIZE bytes.

Updated some comments describing the code in question.

Differential Revision:	https://reviews.freebsd.org/D10645
Reviewed by:		kib, jhb, gallatin, scottl
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-05-16 14:21:37 +00:00
Jonathan Anderson
7a36bd9ffd Rename rtld's parse_libdir to parse_integer.
This is a more accurate name, as the integer doesn't have to be a library
directory descriptor. It is also a prerequisite for more argument parsing
coming in the near future (e.g., parsing explicit binary descriptors).

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	NSERC
2017-05-16 13:27:44 +00:00
Luiz Otavio O Souza
018101a836 Add the Marvell SDHCI controller to the list of supported devices in
sdhci_fdt.

Enable the SDHCI controller, bus and devices on ARMADA38X kernel.

Tested on:	ClearFog Pro
Reviewed by:	Marcin Wojtas <mw at semihalf.com>
Sponsored by:	Rubicon Communications, LLC (Netgate)
Differential Revision:	https://reviews.freebsd.org/D10606
2017-05-16 05:10:15 +00:00
Luiz Otavio O Souza
98a2d78daf Add the SDHCI Address Decoder registers and routines for ARMADA 38X.
Tested on:	ClearFog Pro
Reviewed by:	Marcin Wojtas <mw at semihalf.com>
Sponsored by:	Rubicon Communications, LLC (Netgate)
Differential Revision:	https://reviews.freebsd.org/D10601
2017-05-16 04:47:50 +00:00
Justin Hibbits
611aec2545 Correct pa argument type for pmap_kenter_attr()
Physical addresses are vm_paddr_t, not vm_offset_t.  This can make a difference
when sizeof(vm_offset_t) != sizeof(vm_paddr_t).
2017-05-16 03:31:49 +00:00
Bryan Drewery
611e4bb2eb Enable llvm-objdump by default per r310775 2017-05-16 03:12:51 +00:00
Cy Schubert
d86be5fa4f Implement ippool command line IPv6 address parse support (for the -i
option).

PR:		218433
2017-05-16 02:48:46 +00:00
Jung-uk Kim
e314be0a8d - Revert r317171. [1]
- Fix overlapping corners and fix an off-by-one bug.

MFC after:	3 days
Requested by:	emaste [1]
2017-05-15 23:12:04 +00:00
Enji Cooper
c7d813a93e Start writing up some basic feature tests for procstat
These tests query a running process for information related to the -b,
-c, -e, and -f flags; the -f testcase is largely stubbed out, pending
additional work to determine a good, deterministic descriptor.

Core file test support is coming soon--it requires a bit more effort
due to the fact that:
- coredumps can be disabled (kern.coredump=0).
- corefiles can be put in different directories than the current
  directory, or be named something other than `<prog>.core`
  (`kern.corefile`).

MFC after:	2 months
Sponsored by:	Dell EMC Isilon
2017-05-15 22:52:25 +00:00
Gleb Smirnoff
cc487c1697 Reduce in_pcbinfo_init() by two params. No users supply any flags to this
function (they used to say UMA_ZONE_NOFREE), so flag parameter goes away.
The zone_fini parameter also goes away.  Previously no protocols (except
divert) supplied zone_fini function, so inpcb locks were leaked with slabs.
This was okay while zones were allocated with UMA_ZONE_NOFREE flag, but now
this is a leak.  Fix that by suppling inpcb_fini() function as fini method
for all inpcb zones.
2017-05-15 21:58:36 +00:00
Toomas Soome
c48eb1f427 loader: add ip layer code into libstand
Implement simple separate ip module and fragment re-assembly.

The work is based on send and receive previously implemented in udp.c,
moved to ip.c and added the ip fragment re-assembly.

This change allows to specify larger tftp or nfs payload, such as:
tftp.blksize=4096 or nfs.read_size=4096

Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D10631
2017-05-15 21:50:34 +00:00
Mark Johnston
de3a96e3b1 Ensure that profile and tick probes provide a non-zero PC value.
The idle thread may process callouts while reloading the timer in
cpu_activeclock(). In this case, provide a representative value, &cpu_idle,
instead of 0 for args[0] so that the active thread can be more easily
identified from the probe.

This addresses intermittent failures of the profile-n/tst.argtest.d test.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D10651
2017-05-15 21:44:40 +00:00
Konstantin Belousov
bd101a6648 Ensure that resume path on amd64 only accesses page tables for normal
operation after processor is configured to allow all required
features.

In particular, NX must be enabled in EFER, otherwise load of page
table element with nx bit set causes reserved bit page fault.  Since
malloc uses direct mapping for small allocations, in particular for
the suspension pcbs, and DMAP is nx after r316767, this commit tripped
fault on resume path.

Restore complete state of EFER while wakeup code is still executing
with custom page table, before calling resumectx, instead of trying to
guess which features might be needed before resumectx restored EFER on
its own.

Bisected and tested by:	trasz
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2017-05-15 20:52:43 +00:00
Ed Maste
f701bdc59e bsdgrep: add more tests for different binary flags
The existing 'binary' test in netbsd-tests/ does a basic check of the
default treatment for binary behavior, but not much more than that.
Given some opportunity for breakage recently that did not trigger any
failures, add some tests to cover the three different binary file
behaviors (a, -I, -U) and their --binary-files= equivalent values.

Submitted by:	Kyle Evans <kevans91@ksu.edu>
Reviewed by:	cem, ngie
Differential Revision:	https://reviews.freebsd.org/D10620
2017-05-15 20:41:29 +00:00
Ed Maste
a520574d76 uniq: allow -c to be used with -d or -u
Bring in some bits from NetBSD and lift the restriction in uniq(1) that
-c cannot be used with the -d and -u options.  This restriction seems
unnecessary and is supported at least by GNU, OpenBSD, and NetBSD.  Lift
the restriction and simplify the show() logic a little bit to maintain
functionality when -c is provided with -d/-u.

Also with this change, -d and -u are now actually a mutually exclusive,
albeit valid, combination.  Given that they both indicate opposite
behavior, uniq(1) will no longer output anything if both -d and -u are
supplied.  This is in line with NetBSD as well as GNU.

Adjust the man page and usage() to reflect that -c is its own standalone
option.

PR:		200553
Submitted by:	Kyle Evans <kevans91@ksu.edu>
Reviewed by:	cem, emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D10694
2017-05-15 20:18:14 +00:00
Enji Cooper
33cbbff80f lib/libc/gen/realpath_test: make check result from getcwd(3)
This is being done to avoid dereferencing a NULL pointer via strlcat,
obscuring the underlying issue with the getcwd(3) call.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-15 19:58:01 +00:00
Stephen J. Kiernan
f55d7dd1c9 Add information to open(2) man page about the O_VERIFY flag.
Reviewed by:	bjk wblock
Approved by:	sjg (mentor)
Obtained from:	Juniper Networks, Inc.
2017-05-15 19:32:26 +00:00
Konstantin Belousov
0fc65b0ab8 Make ld-elf.so.1 directly executable.
Check if passed phdr is actually phdr of the interpreter itself, and
decide that this is the case of direct execution.  In this case, the
binary to activate is specified in the argv[1].  After opening it,
shift down on-stack structure with argv, env and aux vectors to
emulate execution of the binary and not of the interpreter.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D10701
2017-05-15 18:48:58 +00:00
Konstantin Belousov
9104191924 Fix the AT_EXECFD functionality.
If the mapped object is linked at specific address, we must obey it.
If AT_EXECFD is not used, only in-kernel ELF image activator needed to
keep the mapping address, since only binaries are linked at the fixed
address, and binaries are mapped by kernel in this case.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
X-Differential revision:	https://reviews.freebsd.org/D10701
2017-05-15 18:47:25 +00:00
Navdeep Parhar
3f1466a535 cxgbe(4): Avoid an out of bounds access when an attempt to unbind a tx
queue from a traffic class fails.

Reported by:	x ksi <s3810 at pjwstk edu pl>
MFC after:	3 days
2017-05-15 18:18:32 +00:00