Commit Graph

113450 Commits

Author SHA1 Message Date
Oleksandr Tymoshenko
16bacb8a2d Do not set FB_FLAG_MEMATTR if VM_MEMATTR_WRITE_COMBINING is not available
Pintyhat to: gonzo
Spotted by: jmallett
2016-10-14 01:23:21 +00:00
Oleksandr Tymoshenko
be4b107168 Fix BCM238x framebuffer driver build for ARM64
VM_MEMATTR_WRITE_COMBINING can be undefined for some platforms, use it only
if it's defined
2016-10-14 00:42:08 +00:00
Oleksandr Tymoshenko
8ff1636c1a Fix BCM283x(Raspberry Pi) SDHCI driver for ARM64 build
- Revert BUS_SPACE_PHYSADDR back to rman_get_start. BUS_SPACE_PHYSADDR was
    introduced in 2013 as temporary wrapper until proper solution appears.
    It's ARM only and since we need this file for ARM64 build and no proper
    API has been introduced - just revert the change and make sure it's
    going to appear when people grep for BUS_SPACE_PHYSADDR in sources.

- Fix printf format for size_t variables
2016-10-13 23:29:24 +00:00
Baptiste Daroussin
1b46e63d3c Stop closing the network device when netbooting for loaders using the common
dev_net.c code.

The NETIF_OPEN_CLOSE_ONCE flag was added in r201932 to prevent that behaviour
on some architectures (sparc64 and powerpc64) the default was left to always
open and close the device for each open and close of a file by the loader
because it was necessary for u-boot on arm.

Since it has been added, the flag was turned on for every arches including the
u-boot loader for arm.

This also fixes netbooting on RPi3 (tested by gonzo@)

For the loader.efi it greatly speeds up netbooting

Reviewed by:	emaste, gonzo, tsoome
Approved by:	gonzo
MFC after:	1 month
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D8230
2016-10-13 22:43:49 +00:00
Mark Johnston
eb17fb15b3 Plug a potential vnode lock leak in vm_fault_hold().
Reviewed by:	alc, kib
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8242
2016-10-13 20:39:34 +00:00
Kristof Provost
1f4955785d pf: port extended DSCP support from OpenBSD
Ignore the ECN bits on 'tos' and 'set-tos' and allow to use
DCSP names instead of having to embed their TOS equivalents
as plain numbers.

Obtained from:	OpenBSD
Sponsored by:	OPNsense
Differential Revision:	https://reviews.freebsd.org/D8165
2016-10-13 20:34:44 +00:00
Gleb Smirnoff
cc94f0c2d7 - Revert r300854, r303657 which tried to fix regression from r297225.
- Fix the regression proper way using RO_RTFREE().

Submitted by:	ae
2016-10-13 20:15:47 +00:00
Navdeep Parhar
721f5406c8 cxgbe(4): Allow the interface MTU to be set as high as the actual
hardware limit.

Submitted by:	jpaetzel@
Differential Revision:	https://reviews.freebsd.org/D8237
2016-10-13 19:40:21 +00:00
Ganael LAPLANCHE
2ee1ec5d82 Fix panic() message reporting ufs instead of nandfs
PR:		213438
Approved by:	kib
2016-10-13 19:33:07 +00:00
Gleb Smirnoff
ec7bbf1f79 With build without TCP_HHOOK and with INVARIANTS. Before mutex.h came
via sys/hhook.h -> sys/rmlock.h -> sys/mutex.h.
2016-10-13 18:02:29 +00:00
Ed Maste
fb892dbae0 Fix octeon model comparison in Cavium SDK
buildkernel failed with GCC 5.3 with
error: comparison of constant '852736' with boolean expression is always true

Sponsored by:	The FreeBSD Foundation
2016-10-13 17:16:32 +00:00
Ed Maste
221cc677ed Convert ­ U+00AD soft hyphen to - in Cavium Octeon SDK
Linux's copy of the Cavium SDK does not have these non-ASCII characters
and this reduces noise in diffs when comparing the two.

Sponsored by:	The FreeBSD Foundation
2016-10-13 16:57:19 +00:00
Adrian Chadd
562b9792f0 [net80211] remove now duplicate copy of the QOSDATA check macro. 2016-10-13 16:45:01 +00:00
Adrian Chadd
f3ef2aa1bd [net80211] add some more QoS frame subtypes. 2016-10-13 16:41:34 +00:00
Konstantin Belousov
5975e53d40 Fix a race in vm_page_busy_sleep(9).
Suppose that we have an exclusively busy page, and a thread which can
accept shared-busy page.  In this case, typical code waiting for the
page xbusy state to pass is
again:
	VM_OBJECT_WLOCK(object);
	...
	if (vm_page_xbusied(m)) {
		vm_page_lock(m);
 		VM_OBJECT_WUNLOCK(object);    <---1
		vm_page_busy_sleep(p, "vmopax");
 		goto again;
	}

Suppose that the xbusy state owner locked the object, unbusied the
page and unlocked the object after we are at the line [1], but before we
executed the load of the busy_lock word in vm_page_busy_sleep().  If it
happens that there is still no waiters recorded for the busy state,
the xbusy owner did not acquired the page lock, so it proceeded.

More, suppose that some other thread happen to share-busy the page
after xbusy state was relinquished but before the m->busy_lock is read
in vm_page_busy_sleep().  Again, that thread only needs vm_object lock
to proceed.  Then, vm_page_busy_sleep() reads busy_lock value equal to
the VPB_SHARERS_WORD(1).

In this case, all tests in vm_page_busy_sleep(9) pass and we are going
to sleep, despite the page being share-busied.

Update check for m->busy_lock == VPB_UNBUSIED in vm_page_busy_sleep(9)
to also accept shared-busy state if we only wait for the xbusy state to
pass.

Merge sequential if()s with the same 'then' clause in
vm_page_busy_sleep().

Note that the current code does not share-busy pages from parallel
threads, the only way to have more that one sbusy owner is right now
is to recurse.

Reported and tested by:	pho (previous version)
Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D8196
2016-10-13 14:41:05 +00:00
Michael Tuexen
859422cc12 Mark the socket as un-writable when it is 1-to-1 and the SCTP association
is freed.

MFC after:	1 month
2016-10-13 13:53:01 +00:00
Michael Tuexen
4c7fb0cf6e Whitespace changes.
MFC after: 1 month
2016-10-13 13:38:14 +00:00
Andrew Turner
1890f18cbe Move printing the AArch64 ID registers to a new SYSINIT, the previous
location only prints them when booting on SMP with multiple cores.

MFC after:	1 week
Sponsored by:	DARPA, AFRL
2016-10-13 09:06:29 +00:00
Andriy Gapon
f1519c0157 convert iicsmb to use iicbus_transfer for all operations
Previously the driver used more low level operations like iicbus_start
and iicbus_write.  The problem is that those operations are not
implemented by iicbus(4) and the calls were effectively routed to
a driver to which the bus is attached.
But not all of the controllers implement such low level operations
while all of the drivers are expected to have iicbus_transfer.

While there fix incorrect implementation of iicsmb_bwrite and iicsmb_bread.
The former should send a byte count before the actual bytes, while the
latter should first receive the byte count and then receive the bytes.

I have tested only these commands:
- quick (r/w)
- send byte
- receive byte
- read byte
- write byte

MFC after:	1 month
Differential Revision: https://reviews.freebsd.org/D8170
2016-10-13 07:25:18 +00:00
Warner Losh
b2a7ac4802 Fix building on i386 and arm. But 'public domain' headers on the files
with no creative content. Include "lost" changes from git:
o Use /dev/efi instead of /dev/efidev
o Remove redundant NULL checks.

Submitted by: kib@, dim@, zbb@, emaste@
2016-10-13 06:56:23 +00:00
Conrad Meyer
d9ce8a41ea kern_linker: Handle module-loading failures in preloaded .ko files
The runtime kernel loader, linker_load_file, unloads kernel files that
failed to load all of their modules. For consistency, treat preloaded
(loader.conf loaded) kernel files in the same way.

Reviewed by:	kib
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D8200
2016-10-13 02:06:23 +00:00
Andriy Voskoboinyk
bdc7291ec9 net80211: convert all ieee80211_input_mimo*() consumers
to ieee80211_add_rx_params() + drop last (ieee80211_rx_stats) parameter

Note: there is an additional check for ieee80211_get_rx_params()
return value (which does not exist in the original diff).

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D8207
2016-10-12 20:50:13 +00:00
Oleksandr Tymoshenko
968d859d09 [fdt] Add one more heuristic to determine MAC address of the SMSC device
- If check for net,ethernet/usb,device compatible node fails, try to find
    .../usb/hub/ethernet, where ... is bus path that can depend on actual HW.
    net,ethernet/usb,device compatibity strings are FreeBSD custom invention
    that is used only in RPi DTBs and since there is no other way to tie USB
    device to FDT node we just do our best effort here to work with upstream
    device tree

- Use -1 value to indicate invalid phandle_t, 0 is valid phandle value and
    shouldn't be used as error signal
2016-10-12 19:53:10 +00:00
Jonathan T. Looney
68bd7ed102 The TFO server-side code contains some changes that are not conditioned on
the TCP_RFC7413 kernel option. This change removes those few instructions
from the packet processing path.

While not strictly necessary, for the sake of consistency, I applied the
new IS_FASTOPEN macro to all places in the packet processing path that
used the (t_flags & TF_FASTOPEN) check.

Reviewed by:	hiren
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D8219
2016-10-12 19:06:50 +00:00
Ed Maste
de1cac0d4b Add COMPAT_FREEBSD10 to the MIPS ERL kernel config
As of r302092, pipe is a wrapper around pipe2 and the pipe syscall is no
longer used. It is included only with the COMPAT_FREEBSD10 kernel option.
Add the compat option to support upgrades from systems with an earlier
userland.

MFC after:	1 week
2016-10-12 18:49:30 +00:00
Oleksandr Tymoshenko
c38fb7809f INTRNG: Propagate IRQ activation error to API consumer
Keep resource state consistent with INTRNG state - if intr_activate_irq
fails - deactivate resource and propagate error to calling function

Reviewed by:	mmel
2016-10-12 17:10:59 +00:00
Ruslan Bukin
11dc8730a6 Keep in-sync MK_SSP=no option both with kernel and userspace.
Pointed out by:	emaste
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-10-12 13:51:41 +00:00
Ed Maste
c874ff0f63 Use M_WAITOK in PIO_KEYMAP ioctl
The malloc return value is not checked.

Submitted by:	CTurt <ecturt@gmail.com>
MFC after:	1 week
2016-10-12 12:56:18 +00:00
Andriy Gapon
7c942547f2 remove a few stray spaces from sys/param.h 2016-10-12 11:17:10 +00:00
Andriy Gapon
32fdc4184a bump __FreeBSD_version for libzfs_core.h 2016-10-12 11:12:31 +00:00
Alexander Motin
25ee4c0429 Use copyout() instead of pointing sbuf to user-space buffer.
MFC after:	2 weeks
2016-10-12 08:25:13 +00:00
Andriy Gapon
94dce59911 smbus: allow child devices to be added via hints
This will allow to add slave drivers in the same fashion as for iicbus.

Also, allow other code to add a child device and set its 'addr' ivar.
The ivar can only be set if it's unset, it can not be changed.
That could be used, for example, by a platform driver that has
a precise description of the hardware and, thus, knows what drivers
can handle what slaves.

The slave auto-probing code is unsafe and broken because it uses
7-bit slave addresses.  It's going to be removed.

Note: internally the driver uses address of zero as an unset address
while smbus_get_addr() returns it as -1 for compatibility reasons.
The address is expected to be unset only for children that do not
work with slaves like, for example, smb(4).

Reviewed by:	jhb
Differential Revision: https://reviews.freebsd.org/D8173
2016-10-12 06:58:01 +00:00
Oleksandr Tymoshenko
0e3cfd98fc Fix typo in comment
Spotted by: loos
2016-10-12 05:35:57 +00:00
Oleksandr Tymoshenko
bf798f819a Make BCM28x USB driver compatible with upstream device tree
This should have been committed in r307093: resource allocation depends
on source of the device tree. upstream dts has extra interrupt that we can
ignore
2016-10-12 03:36:46 +00:00
Oleksandr Tymoshenko
79f6c27f4c Make VCHI driver compatible with upstream DT
- Add compatibility string
- Compensate difference in base address between our custom DTB and upstream one
2016-10-12 03:08:58 +00:00
Oleksandr Tymoshenko
43be86e31b Make BCM283x USB driver compatible with upstream DT
- Make resource allocation logic depend on compatibility string
    to check what format of DTS node should be used - FreeBSD's or upstream
2016-10-12 03:07:49 +00:00
Oleksandr Tymoshenko
aa2959bae5 Make BCM2835 GPIO driver compatible with upstream DT
- Add compatibility string
- Make reserverd and read-only properties optional
2016-10-12 03:06:05 +00:00
Oleksandr Tymoshenko
38e62ae597 Add compatibility string from upstream DT 2016-10-12 03:03:55 +00:00
Oleksandr Tymoshenko
5a715e8aa2 Make framebuffer driver compatible with upstream DT
- Add compatibility string
- Add simplebus as possible parent bus
2016-10-12 03:03:05 +00:00
Oleksandr Tymoshenko
9d6eb8bb3d Add compatible strings used in upstream dts files 2016-10-12 03:00:42 +00:00
Oleksandr Tymoshenko
511bc527ff Make sure intc is attached before interrupt consumers
If pass order is not specified devices are attached in the order they are
defined in dts. Some interrupt consumers may be defined before intc. Also
make sure intc interrupt-parent local_intc is attached before intc itself.
2016-10-12 02:58:27 +00:00
Jonathan T. Looney
4527476029 Currently, when tcp_input() receives a packet on a session that matches a
TCPCB, it checks (so->so_options & SO_ACCEPTCONN) to determine whether or
not the socket is a listening socket. However, this causes the code to
access a different cacheline. If we first check if the socket is in the
LISTEN state, we can avoid accessing so->so_options when processing packets
received for ESTABLISHED sessions.

If INVARIANTS is defined, the code still needs to access both variables to
check that so->so_options is consistent with the state.

Reviewed by:	gallatin
MFC after:	1 week
Sponsored by:	Netflix
2016-10-12 02:30:33 +00:00
Jonathan T. Looney
bd79708dbf In the TCP stack, the hhook(9) framework provides hooks for kernel modules
to add actions that run when a TCP frame is sent or received on a TCP
session in the ESTABLISHED state. In the base tree, this functionality is
only used for the h_ertt module, which is used by the cc_cdg, cc_chd, cc_hd,
and cc_vegas congestion control modules.

Presently, we incur overhead to check for hooks each time a TCP frame is
sent or received on an ESTABLISHED TCP session.

This change adds a new compile-time option (TCP_HHOOK) to determine whether
to include the hhook(9) framework for TCP. To retain backwards
compatibility, I added the TCP_HHOOK option to every configuration file that
already defined "options INET". (Therefore, this patch introduces no
functional change. In order to see a functional difference, you need to
compile a custom kernel without the TCP_HHOOK option.) This change will
allow users to easily exclude this functionality from their kernel, should
they wish to do so.

Note that any users who use a custom kernel configuration and use one of the
congestion control modules listed above will need to add the TCP_HHOOK
option to their kernel configuration.

Reviewed by:	rrs, lstewart, hiren (previous version), sjg (makefiles only)
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D8185
2016-10-12 02:16:42 +00:00
Sepherosa Ziehau
368bf0c2c6 ifnet: Use if_link_state snapshot to invoke ifnet_link_event
So that everyone in this task have consistent view of link state.

Reviewed by:	ae
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8214
2016-10-12 01:52:29 +00:00
Ed Maste
2a059700b6 Use correct size type in do_setopt_accept_filter
Submitted by:	ecturt@gmail.com
2016-10-12 00:56:49 +00:00
Warner Losh
943ac2b07e Include stubs even on the platforms we don't support so libsysdecode
continues to build.
2016-10-11 22:54:29 +00:00
Warner Losh
852dd45ebc Properly include the 802.11n PHY support files when the BWM_GPL_PHY
option is included. Remove the comment suggesting that people
uncomment things because it is OBE.
2016-10-11 22:32:12 +00:00
Warner Losh
f79d484dff Create /dev/efidev to provide an ioctl interface to
userland.  It supports userland interfaces to UEFI Runtime Services. This is
indended to the the MI portion of EFI RuntimeServices support.

Differential Revision: https://reviews.freebsd.org/D8128
Reviewed by: kib@, wblock@, Ganael Laplanche
2016-10-11 22:24:30 +00:00
Oleksandr Tymoshenko
58a3e50de6 Make Rapsberry Pi watchdog driver compatible with upstream DTS
- Fix compatibility strings
- Compensate the difference in base address for our custom DTS and
    upstream one (for backward compatibility)
2016-10-11 21:40:15 +00:00
Oleksandr Tymoshenko
98884a9ea9 Make intc driver compatible with upstream DTS
- Fix compatibility strings
- Properly decode upstream's two-cell interrupt specs. Our home-made dts
    does not have two-cell interrupts so no need to preserve backward
    compatibility
2016-10-11 21:37:34 +00:00