Commit Graph

109187 Commits

Author SHA1 Message Date
Navdeep Parhar
fddd4f6273 Plug leak in m_unshare.
m_unshare passes on the source mbuf's flags as-is to m_getcl and this
results in a leak if the flags include M_NOFREE.  The fix is to clear
the bits not listed in M_COPYALL before calling m_getcl.  M_RDONLY
should probably be filtered out too but that's outside the scope of this
fix.

Add assertions in the zone_mbuf and zone_pack ctors to catch similar
bugs.

Update netmap_get_mbuf to not pass M_NOFREE to m_getcl.  It's not clear
what the original code was trying to do but it's likely incorrect.
Updated code is no different functionally but it avoids the newly added
assertions.

Reviewed by:	gnn@
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D5698
2016-03-26 23:39:53 +00:00
Dmitry Chagin
09806d8e3e When write(2) on eventfd object fails with the error EAGAIN do not return
the number of bytes written.

MFC after:	1 week
2016-03-26 19:16:53 +00:00
Dmitry Chagin
2bb14e7541 Implement O_NONBLOCK flag via fcntl(F_SETFL) for eventfd object.
MFC after:	1 week
2016-03-26 19:15:23 +00:00
Andrew Turner
bdb976c4a3 Only define the platform methods for the Allwinner platforms we are
building for.

Sponsored by:	ABT Systems Ltd
2016-03-26 17:49:46 +00:00
Allan Jude
7156379416 Do not prompt for GELI passphrase is encrypted with keys only
PR:		208251
Submitted by:	Fabian Keil <fk@fabiankeil.de>
Sponsored by:	ScaleEngine Inc.
2016-03-26 15:39:48 +00:00
Michal Meloun
8cc018c369 ARM: Fix bug introduced in r297286.
- don't put command line without guard to kernel environment.
 - kernel environment delivered from ubldr must have absolute precedence.
2016-03-26 12:19:27 +00:00
Michal Meloun
58872fc01a TEGRA: Fixes for UART driver:
- add mising 'or' in tegra_uart_attach()
   Pointed by: kan
 - fix indentation of tegra_softc
 - remove forgoten debug printf
2016-03-26 10:09:28 +00:00
Andriy Voskoboinyk
9b56252e4d net80211: fix panic for DWDS vaps
Since r248069, TX IC lock must obtained before calling ieee80211_encap()
and/or ieee80211_parent_xmitpkt().

Tested with: Intel 3945BG.
2016-03-26 08:59:56 +00:00
Michal Meloun
e64c374375 ARM: Parse command line delivered by U-Boot:
- in atags
- in DT blob (by using 'fdt chosen' U-Boot command)

The command line must start with guard's string 'FreeBSD:' and can contain
list of comma separated kenv strings. Also, boot modifier strings from
boot.h are recognised and parsed into boothowto.

The command line must be passed from U-Boot by setting of bootargs variable:
'setenv bootargs FreeBSD:boot_single=1,vfs.root.mountfrom=ufs:/dev/ada0s1a'
followed by 'fdt chosen' (only for DT based boot)
2016-03-26 06:59:01 +00:00
Michal Meloun
f5c06c61e4 ARM: Fix ATAG handling in LINUX_BOOT_API:
- Don't convert atags address passed from U-Boot. It's real physical
   address (and we have 1:1 mapping).
 - Size of tags is encoded in words, not in bytes
2016-03-26 06:57:36 +00:00
Michal Meloun
fda16d46fe ARM: Teach LINUX_BOOT_ABI to recognize DT blob.
This allow us to boot FreeBSD kernel (using uImage encapsulation) directly
from U-boot using 'bootm' command or by Android fastboot loader.
For now, kernel uImage must be marked as Linux, but we can add support for
FreeBSD into U-Boot later.
2016-03-26 06:55:55 +00:00
Bryan Drewery
59f6130d2a Implement (ACFLAGS|CFLAGS|CXXFLAGS).SRC globally.
Sponsored by:	EMC / Isilon Storage Division
2016-03-26 03:46:12 +00:00
Conrad Meyer
c975a5d359 Add td_swinvoltick to track last involuntary context switch
Expose in DDB via "show thread."

Reviewed by:	markj
Sponsored by:	EMC / Isilon Storage Division
2016-03-25 19:35:29 +00:00
Edward Tomasz Napierala
938bcb04fc Fix iSCSI initiator crash that could happen with out-of-memory
conditions with in-flight IO and subsequent reconnection.

PR:		199117
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5673
2016-03-25 16:01:40 +00:00
Sepherosa Ziehau
489f0c3c17 tcp/lro: Return TCP_LRO_NO_ENTRIES if we are short of LRO entries.
So that callers could react accordingly.

Reviewed by:	gallatin (no objection)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5695
2016-03-25 02:54:13 +00:00
Bryan Drewery
3733897532 Remove unneeded return left from refactoring.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-25 00:14:56 +00:00
Alexander Motin
fc6eef7aa8 Unify ichwd(4) attachment messages in dmesg.
MFC after:	2 weeks
2016-03-24 23:24:00 +00:00
Ed Schouten
3cf50041ef Regenerate system call table after r297247. 2016-03-24 21:49:39 +00:00
Ed Schouten
1f3bbfd875 Replace the CloudABI system call table by a machine generated version.
The type definitions and constants that were used by COMPAT_CLOUDABI64
are a literal copy of some headers stored inside of CloudABI's C
library, cloudlibc. What is annoying is that we can't make use of
cloudlibc's system call list, as the format is completely different and
doesn't provide enough information. It had to be synced in manually.

We recently decided to solve this (and some other problems) by moving
the ABI definitions into a separate file:

	https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt

This file is processed by a pile of Python scripts to generate the
header files like before, documentation (markdown), but in our case more
importantly: a FreeBSD system call table.

This change discards the old files in sys/contrib/cloudabi and replaces
them by the latest copies, which requires some minor changes here and
there. Because cloudabi.txt also enforces consistent names of the system
call arguments, we have to patch up a small number of system call
implementations to use the new argument names.

The new header files can also be included directly in FreeBSD kernel
space without needing any includes/defines, so we can now remove
cloudabi_syscalldefs.h and cloudabi64_syscalldefs.h. Patch up the
sources to include the definitions directly from sys/contrib/cloudabi
instead.
2016-03-24 21:47:15 +00:00
Alexander Motin
baa7dd65be Polish wbwd(4) driver and add more supported chips.
MFC after:	1 month
2016-03-24 20:52:35 +00:00
Gleb Smirnoff
c8f59118be Space and style(9) corrections for recent mbuf changes. 2016-03-24 20:06:52 +00:00
Sean Bruno
844b798499 Add 4k enabled cam quirks for Samsung SM863 Series SSDs
Submitted by:	Jason (j@nitrology.com)
MFC after:	2 weeks
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D5711
2016-03-24 14:20:33 +00:00
Edward Tomasz Napierala
42ed64e39b Speed up lookups in autofs(5) by using red-black trees instead of linear
searches.

Reviewed by:	kib@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5627
2016-03-24 13:34:39 +00:00
Wojciech Macek
f379b4636a arm64: Fixing user space boudary checking in copyinout.S
Big buffer size could cause integer overflow and as a result
attempt to copy beyond VM_USERMAX_ADDRESS.

Fixing copyinstr boundary checking where compared value has been
overwritten by accident when setting fault handler.

Submitted by:          Dominik Ermel <der@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium
Reviewed by:           kib
Differential Revision: https://reviews.freebsd.org/D5719
2016-03-24 13:28:33 +00:00
Bjoern A. Zeeb
4f321dbd1c Fix compile errors after r297225:
- properly V_irtualise variable access unbreaking VIMAGE kernels.
- remove the volatile from the function return type to make architecture
  using gcc happy [-Wreturn-type]
  "type qualifiers ignored on function return type"
  I am not entirely happy with this solution putting the u_int there
  but it will do for now.
2016-03-24 11:40:10 +00:00
Alexander Motin
52c9b0b539 Unify ignoring EEXIST from zvol_create_minor().
This fixes creation of zvol devices for snapshots during zfs receive,
that previously failed with "ZFS WARNING: Unable to create ZVOL" message.
This solution is not perfect, but IMHO better then it was before.

MFC after:	2 weeks
2016-03-24 10:10:41 +00:00
Konstantin Belousov
58a236093c Handle the driver KPI change from r292373. Ensure that managed device
pagers fault routines always return with a result page, be it the
proper and valid result page, or initially passed freshly allocated
placeholder.  Do not free the passed in page until we are able to
provide the replacement, and do not assign NULL to *mres.

Reported and tested by:	dumbbell
Reviewed by:	royger (who also verified that Xen code is safe)
Sponsored by:	The FreeBSD Foundation
2016-03-24 09:56:53 +00:00
Svatopluk Kraus
61c8fde5d6 Generalize IPI support for ARM intrng and use it for interrupt
controller IPI provider.

New struct intr_ipi is defined which keeps all info about an IPI:
its name, counter, send and dispatch methods. Generic intr_ipi_setup(),
intr_ipi_send() and intr_ipi_dispatch() functions are implemented.

An IPI provider must implement two functions:
(1) an intr_ipi_send_t function which is able to send an IPI,
(2) a setup function which initializes itself for an IPI and
    calls intr_ipi_setup() with appropriate arguments.

Differential Revision:	https://reviews.freebsd.org/D5700
2016-03-24 09:55:11 +00:00
Hans Petter Selasky
6227e59635 Add more UHCI PCI IDs.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2016-03-24 09:35:29 +00:00
George V. Neville-Neil
dcd070d80a Move mbuf provider under SDT to indicate that it is FreeBSD specific
and not a stable interface.

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	Rubicon Communications (Netgate)
Differential Revision:	https://reviews.freebsd.org/D5716
2016-03-24 08:26:06 +00:00
George V. Neville-Neil
84cc0778d0 FreeBSD previously provided route caching for TCP (and UDP). Re-add
route caching for TCP, with some improvements. In particular, invalidate
the route cache if a new route is added, which might be a better match.
The cache is automatically invalidated if the old route is deleted.

Submitted by:	Mike Karels
Reviewed by:	gnn
Differential Revision:	https://reviews.freebsd.org/D4306
2016-03-24 07:54:56 +00:00
Bryan Drewery
1c9b29f95f Pass the expected struct radix_node_head * to vfs_free_netcred.
No functional change.

struct radix_node_head's first element is rh so this was already
referring to the same address.  It was likely an unintended
s/rnh/&rnh->rh/ change from r294706 as all other rnh_walktree() callers
pass the expected struct radix_node_head * rather than obscurely passing
the address of their first element.

Sponsored by:	EMC / Isilon Storage Division
2016-03-24 04:40:07 +00:00
Bryan Drewery
57a8e34141 Fix M_RTABLE memory leak from r274118 (11/2014).
Replace free(M_RTABLE) with rn_detachhead() to match rn_inithead().

This would trigger when reloading NFS exports and was similar to
problems with pf reload [1].

PR:		194078 [1]
Sponsored by:	EMC / Isilon Storage Division
2016-03-24 03:08:39 +00:00
Sepherosa Ziehau
4793a1da1c hyperv/vmbus: Create per-cpu fast taskqueue for msg handling
Using one taskqueue does not work, since the EOM MSR must be written
on the msg's owner CPU.

Noticed by:	Jun Su <junsu microsoft com>
Discussed with:	Jun Su <junsu microsoft com>, Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-03-24 02:15:23 +00:00
Sepherosa Ziehau
0fc8db6eed hyperv/utils: Allow hint to disable individual utility
Reviewed by:	kib, Dexuan Cui <decui microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5714
2016-03-24 01:12:28 +00:00
Sepherosa Ziehau
25a40f12b0 hyperv/vmbus: use a better retry method in hv_vmbus_post_message()
Most often, hv_vmbus_post_message() doesn't fail.  However, it fails
intermittently when GPADLs of large shared memory is to be established
with the host, e.g. on the hn(4) attach path: a GPADL of 15MB sendbuf
is created, for which lots of messages will be flooded to the host.
The host side tries to throttle the message rate by returning
HV_STATUS_INSUFFICIENT_BUFFERS.

Before this commit, we do several retries for failed messages, but the
delay between each retry is pretty/too low, which will cause sporadic
message posting failure.  We now use large delay (>=1ms) between each
retry to fix the message posting failure.

Submitted by:	Dexuan Cui <decui microsoft com>
Reviewed by:	sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5715
2016-03-24 00:40:41 +00:00
John Baldwin
7a2c1d8c60 Enable interrupts on the BSP once all PICs are initialized.
This moves the enabling of interrupts slightly earlier (the old location
was still before devices were enumerated and probed) and does it in the
interrupt code (rather than in the device configuration code).  This
also avoids tripping over an assertion on the first TLB shootdown with
earlier AP startup.

Reviewed by:	kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D5710
2016-03-24 00:24:07 +00:00
Jared McNeill
64f86dc4cb Fix support for fixed factor clocks.
- Use a different device description for fixed and fixed factor clocks.
 - Fix a bug where the "clock-div" property was stored in the "mult" field
   of the clock definition.
 - Get the fixed factor parent clock by index instead of by name, as a
   clock-names property is not required to be present here.

Reviewed by:		mmel, adrian (mentor)
Approved by:		adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5703
2016-03-23 19:26:53 +00:00
Jared McNeill
694f5cae46 clk_parse_ofw_out_names is supposed to return a list of indices when the
clock-indices property is present, so change the "uint32_t *indices" parameter
to "uint32_t **indices" to allow this.

Reviewed by:		mmel, adrian (mentor)
Approved by:		adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5702
2016-03-23 19:24:09 +00:00
Jared McNeill
e1f3a8ce54 Return BUS_PROBE_GENERIC instead of 0 from ofw_clkbus_probe, giving
platform specific drivers a chance to override the generic driver.

Reviewed by:		mmel, adrian (mentor)
Approved by:		adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5701
2016-03-23 19:21:21 +00:00
Wojciech Macek
f3e730a1e5 ARM64 copyinout improvements
The first of set of patches.
Use wider load/stores when aligned buffer is being copied.

In a simple test:
  dd if=/dev/zero of=/dev/null bs=1M count=1024
the performance jumped from 410MB/s up to 3.6GB/s.

TODO:
 - better handling of unaligned buffers (WiP)
 - implement similar mechanism to bzero

Submitted by:          Dominik Ermel <der@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium
Reviewed by:           kib, andrew, emaste
Differential Revision: https://reviews.freebsd.org/D5664
2016-03-23 13:29:52 +00:00
Michael Tuexen
ed65436366 Add const to several constants. Thanks to Nicholas Nethercote for
providing the patch via
https://bugzilla.mozilla.org/show_bug.cgi?id=1255655

MFC after:	1 week
2016-03-23 13:28:04 +00:00
Konstantin Belousov
6336aefc1d Fix locking mistake in softdep_waitidle(). The surrounding code
expects that the loop is always exited with the SU lock owned, even on
error.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2016-03-23 09:58:51 +00:00
Bryan Drewery
9b511ce96b Handle copyin failures.
Skip the log entry as there is nothing good to write out.  Don't fail
the syscall though since it already succeeded.  There's no reason
filemon's tracing failure should fail the already-succeeded syscall.

Record the error for later to return from close(2) on the filemon devfs
file descriptor.

Discussed with:	markj, sjg, kib (briefly with kib)
Reported by:	mjg
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-22 22:41:14 +00:00
Bryan Drewery
eac5c9f26f Remove unused done argument to copyinstr(9).
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-22 22:41:10 +00:00
Bryan Drewery
4177d9f7d3 Return any log write failure encountered when closing the filemon fd.
Discussed with:	sjg, markj
Reviewed by:	sjg
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-22 22:41:07 +00:00
Bryan Drewery
4d9fbc5518 Follow-up r297156: Close the log in filemon_dtr rather than in the last reference.
If the tracer has decided to the close the log then it should be fully
written, not getting more entries, when close(2) returns.  This was
a regression in r297156 in that it allowed a traced process to continue
a traced syscall and add more entries to the log while the tracer had
already closed its fd or exited.  This was only really part of the
daemonized process case which is abnormal.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-03-22 22:41:03 +00:00
Justin Hibbits
f8fd3fb518 Fix the resource_list_print_type() calls to use uintmax_t.
Missed a bunch from r297000.
2016-03-22 22:25:08 +00:00
Adrian Chadd
0d66701783 [net80211] add missing static declarations.
Submitted by:	Sascha Wildner <saw@online.de>
Obtained from:	dragonflybsd (https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/822aeeabc8c4c074deea46383f36e6d1cdcd19f5)
2016-03-22 22:07:14 +00:00
Navdeep Parhar
78552b23a5 cxgbe(4): Be consistent and call ETHER_BPF_MTAP before writing anything
to the descriptor ring no matter what path the frame takes within the
driver's tx.
2016-03-22 18:56:23 +00:00