Commit Graph

216105 Commits

Author SHA1 Message Date
Konstantin Belousov
c1538a1365 Add amd64 functions to load/store GDT register, store IDT and TR registers.
Note that lgdt() name is already used for function which, besides
loading GDT, also reloads segment descriptors cache, thus new function
is named bare_lgdt().

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-09-21 10:10:36 +00:00
Konstantin Belousov
195a6bb9e6 Export the pmap_cache_bits() and pmap_pinit_pml4() functions from the
amd64 pmap.

The new pmap_pinit_pml4() function initializes the level 4 page table
with entries for the kernel mappings.  Both functions are needed for
upcoming EFI Runtime Services support.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-09-21 10:05:51 +00:00
Andrew Turner
bc116e04c0 Update the device tree source files to a Linux 4.7-RC.
MFC after:	2 weeks
Sponsored by:	ABT Systems Ltd
2016-09-21 08:54:08 +00:00
Michael Tuexen
5cb9165556 Fix the handling of unordered fragmented user messages using DATA chunks.
There were two bugs:
* There was an accounting bug resulting in reporting a too small a_rwnd.
* There are a bug when abandoning messages in the reassembly queue.

MFC after:	4 weeks
2016-09-21 08:28:18 +00:00
Konstantin Belousov
643f6f47fd Add PROC_TRAPCAP procctl(2) controls and global sysctl kern.trap_enocap.
Both can be used to cause processes in capability mode to receive
SIGTRAP when ENOTCAPABLE or ECAPMODE errors are returned from
syscalls.

Idea by:	emaste
Reviewed by:	oshogbo (previous version), emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D7965
2016-09-21 08:23:33 +00:00
Edward Tomasz Napierala
5271129cd6 Bump __FreeBSD_version after r305988, removal of bio_taskqueue().
Suggested by:	asomers@
2016-09-21 07:25:05 +00:00
Sepherosa Ziehau
b1699fab98 hyperv/hn: Put debug messages under bootverbose
While I'm here, strip blank line.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7963
2016-09-21 06:54:26 +00:00
Andrey A. Chernov
62b939ebfb 1) Microoptimize %p case.
2) Implememt %u for GNU compatibility.
3) Don't forget to advance buf for %w/%u.
4) Fail with incomplete week (week 0) request and no such week in the
year.
5) Fix yday formula when Sunday requested and the week started from Monday.
6) Fail with impossible yday for incomplete week (week 0) and direct %w/%u
request.
7) Shift yday/wday to the first day of the year, if incomplete week
(week 0) requested and no %w/%u used.

MFC after:      7 days
2016-09-21 06:44:32 +00:00
Sepherosa Ziehau
d1c1d97e6a hyperv/vmbus: Assert that the bufring address is page aligned.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7962
2016-09-21 06:43:52 +00:00
Sepherosa Ziehau
7a7e4e4449 hyperv/hn: Allocate bufrings in attach DEVMETHOD.
So that reinitialization, e.g. MTU change, will not fail when the system
memory is excessively fragmented.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7961
2016-09-21 06:27:42 +00:00
Sepherosa Ziehau
9613ad24b0 hyperv/vmbus: Allow bufrings preallocation.
The assumption that the channel is only opened upon synthetic device
attach time no longer holds, e.g. Hyper-V network device MTU changes.
We have to allow device drivers to preallocate bufrings, e.g. in
attach DEVMETHOD, to prevent bufring allocation failure once the
system memory is fragmented after running for a while.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7960
2016-09-21 05:56:47 +00:00
Edward Tomasz Napierala
e313b4dd95 Fix bug introduced with r302388, which could cause processes accessing
automounted shares to hang with "vfs_busy" wchan.

(As a workaround one can run 'automount -u' from cron.)

Reviewed by:	kib@
MFC after:	1 month
2016-09-21 05:44:13 +00:00
Wojciech Macek
0f9f40918d Add support for SPI-mapped MSI interrupts outside of GICv2m.
SPI-mapped MSI interrupts coming from a controller other
than GICv2m need to have their trigger and polarity
properly configured. This patch fixes MSI/MSI-X
on Annapurna Alpine platform with GICv2.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           skra, wma
Differential Revision: https://reviews.freebsd.org/D7698
2016-09-21 05:33:18 +00:00
Wojciech Macek
a134b98878 Add support for SPI-mapped MSI interrupts in GICv3.
PIC_SETUP_INTR implementation in GICv3 did not allow
for setting up interrupts without included FDT
description. GICv2m-like MSI interrupts, which map
MSI messages to SPI interrupt lines, may not have
a description in FDT. Add support for such interrupts
by setting the trigger and polarity to the appropriate
values for MSI (edge, high) and get the hardware
IRQ number from the corresponding ISRC.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7662
2016-09-21 05:22:49 +00:00
Wojciech Macek
3502e7b37c Register GICv3 xref.
This allows other drivers to retrieve interrupt parent node.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma, zbb
Differential Revision: https://reviews.freebsd.org/D7568
2016-09-21 05:15:50 +00:00
Justin Hibbits
f83b285657 Move ofw_parse_bootargs to the correct place.
Also, create a static initial environment, so bootargs can be set from uboot.
2016-09-21 03:10:41 +00:00
Justin Hibbits
14e1a2cd29 Move ofw_cpu file to the main files conf file.
There is nothing CPU specific here, and it's usable by both fdt and Open
Firmware based systems.  Rather than keeping the same file in every one, just
add it to the ofw/fdt block in the main file.
2016-09-21 02:56:57 +00:00
Justin Hibbits
9ed9b26792 Add a ofw_parse_bootargs function, and use it for powerpc
Summary:
If the environment variable is set, U-boot adds a 'bootargs' property to
/chosen.  This is already handled by ARM and MIPS, but should be handled in a
central location.  For now, ofw_subr.c is a good place until we determine if it
should be moved to init_main.c, or somewhere more central to all architectures.

Eventually arm and mips should be modified to use ofw_parse_bootargs() as well,
rather than using the duplicate code already.

Reviewed By: adrian
Differential Revision: https://reviews.freebsd.org/D7846
2016-09-21 02:28:39 +00:00
Justin Hibbits
5bf1e76566 Add yet another QorIQ GPIO compat string.
P1022 boards use the string "fsl,pq3-gpio", which seems to be common in Linux
dts files.
2016-09-21 02:27:23 +00:00
Navdeep Parhar
8c0ca00b72 cxgbe(4): Setup congestion response for T6 rx queues. 2016-09-21 00:50:22 +00:00
Navdeep Parhar
6a0cae68b4 cxgbe(4): Show wcwr_stats for T6 cards. 2016-09-21 00:46:08 +00:00
Mark Johnston
dda945f50a Protect ccbq access with devq->send_mtx in the XPT_ABORT handler.
Submitted by:	Ryan Libby <rlibby@gmail.com>
Reviewed by:	mav
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D7985
2016-09-21 00:08:42 +00:00
Ed Maste
9e8f606352 elfdump: limit STDIN to no rights rather than closing it
Closing stdin/stdout/stderr is often a bad idea as a future open()
can end up with its fd. Leave it open and limit it to no rights
instead.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D7984
2016-09-20 21:38:12 +00:00
Conrad Meyer
85190f81bb dhclient(8): Enable numbered user class ID option
By adding it to the option priorities table.

PR:		184117
Submitted by:	Lowell Gilbert <freebsd-bugs-local at be-well.ilk.org>
Reported by:	Tomek CEDRO <cederom at tlen.pl>
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D7911
2016-09-20 19:21:41 +00:00
Luiz Otavio O Souza
33fe8378ba If present, honor the USB port mode (host or peripheral) set on DTS, if not,
keep the beaglebone defaults: USB0 -> peripheral/gadget, USB1 -> host.

This is only a workaround as in fact fact this hardware is capable of detect
the USB port mode based on type of cable and act according with the detected
mode.  Unfortunately the driver does not handle that at moment.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-09-20 19:06:58 +00:00
Andriy Voskoboinyk
887a63246c net80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.
This field may be used for received frames only.

Differential Revision:	https://reviews.freebsd.org/D3826
Differential Revision:	https://reviews.freebsd.org/D3827
2016-09-20 18:53:42 +00:00
Alan Somers
cc4ee17f44 Fix periodic scripts when an NFS mount covers a local mount
100.chksetuid and 110.neggrpperm try to search through all UFS and ZFS
filesystems. But their logic contains an error. They also search through
remote filesystems that are mounted on top of the root of a local
filesystem. For example, if a user installs a FreeBSD system with the
default ZFS layout, he'll get a zroot/usr/home filesystem. If he then mounts
/usr/home over NFS, these scripts would search through /usr/home.

MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D7482
2016-09-20 18:47:33 +00:00
Mark Johnston
2d12d25c6a Reduce code duplication around NDP message handlers in icmp6_input().
No functional change intended.

MFC after:	2 weeks
2016-09-20 18:08:17 +00:00
Ed Maste
1dd50172b0 Always pass -m to ld for converting binary files to kernel ELF objects
This is in preparation for linking with LLVM's lld, which does not have
a compiled-in default output emulation. lld requires that it is
specified via the -m option, or obtained from the object file(s) being
linked.

This will also allow all build targets to share a common linker binary.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7837
2016-09-20 17:07:14 +00:00
Enji Cooper
43f24e2096 Port vnd_test to FreeBSD
Use mdmfs/mdconfig instead of vndconfig/newfs. vndconfig doesn't exist on FreeBSD.

TODO: need to parameterize out the md(4) device as it's currently hardcoded to "3"
(in both the FreeBSD and NetBSD cases).

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2016-09-20 16:40:15 +00:00
Enji Cooper
534501a247 Port to mknod_test and readdir_test to FreeBSD
The `mknod <file> p` command doesn't exist on FreeBSD, like on NetBSD. Use
mkfifo instead to create named pipes (FIFOs).

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2016-09-20 16:37:02 +00:00
Enji Cooper
548f948a56 Port sizes_test and statvfs_test to FreeBSD
Similar to r306030, use a simpler method for getting the value of
`hw.pagesize`, i.e. `sysctl -n hw.pagesize`. The awk filtering method doesn't
work on FreeBSD

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2016-09-20 16:31:57 +00:00
Enji Cooper
61e13648e7 Port contrib/netbsd-tests/fs/h_funcs.subr to FreeBSD
Use kldstat -m to determine whether or not a filesystem is loaded. This works
well with tmpfs, ufs, and zfs

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2016-09-20 16:28:57 +00:00
Enji Cooper
d3de062383 Port vnode_leak_test:main to FreeBSD
Use a simpler way of dumping kern.maxvnodes, i.e. `sysctl -n kern.maxvnodes`

The awk filtering method employed in NetBSD doesn't work on FreeBSD

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2016-09-20 16:27:34 +00:00
Enji Cooper
92d317a9b5 Use SRCTOP instead of the longhand version for defining the path to contrib/atf
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2016-09-20 16:24:22 +00:00
Warner Losh
8c3dc1fb05 Spell alphabetically correctly both in the commit message AND in the
actual man page. Sigh.

Submitted by: David A Bright and Pedro Giffuni
2016-09-20 15:14:33 +00:00
Ed Maste
23648b7d73 bspatch: Remove backwards-compatibility sys/capability.h support
bspatch previously included sys/capability.h or sys/capsicum.h based
on __FreeBSD_version, as FreeBSD is the upstream for bsdiff and we may
see this file incorporated into other third-party software.

The Capsicum header is now installed as sys/capsicum.h in stable/10 and
FreeBSD 10.3, so we can just use sys/capsicum.h and simplify the logic.

Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D7954
2016-09-20 15:13:15 +00:00
Ed Maste
6f70040b38 mrsas: update for sys/capability.h rename in r263232 2016-09-20 12:59:30 +00:00
Ed Maste
397ff3b872 auditdistd: update for sys/capability.h rename in r263232 2016-09-20 12:58:28 +00:00
Ed Maste
cec1957ae1 hwpmc: remove sys/capability.h backwards compatibility
The Capsicum header is installed as sys/capsicum.h in stable/10 as well.
2016-09-20 12:56:03 +00:00
Wojciech Macek
988d9b3505 Add driver for PCIe root complex on Annapurna Alpine platform.
The driver subclasses pci-host-generic and additionally
performs configuration of vendor-specific PCIe registers.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7571
2016-09-20 11:11:06 +00:00
Konstantin Belousov
65afaac0c3 Move pmap_p*e_index() inline functions from pmap.c to pmap.h.
They are already used in minidump code.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-09-20 09:38:07 +00:00
Wojciech Macek
eaa797943e Update Annapurna Alpine HAL
alpine-hal SerDes file was omitted in the previous commit.
Files added here.
All unnecessary (old) files were also removed.
Merge from vendor-sys, r306017
2016-09-20 09:19:22 +00:00
Edward Tomasz Napierala
0c4440c3aa Follow up r305988 by removing g_bio_run_task and related code.
The g_io_schedule_up() gets its "if" condition swapped to make
it more similar to g_io_schedule_down().

Suggested by:	mav@
Reviewed by:	mav@
MFC after:	1 month
2016-09-20 09:18:33 +00:00
Sepherosa Ziehau
fa8c981396 hyperv/storvsc: Fix SRB length setting.
This fixes disk discovery issue on WS2008R2 Hyper-V, which plagued
us since 10.2-release.

Reported by:	many
MFC after:	3 days
Sponsored by:	Microsoft
2016-09-20 08:52:45 +00:00
Sepherosa Ziehau
5260781e82 hyperv/hn: Let the caller of hn_nvs_doinit() do the error logging.
So that NVS version probing failure does not look too scary.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7950
2016-09-20 05:45:18 +00:00
Sepherosa Ziehau
a572f6042a hyperv/hn: Fix ifnet hwassist setup.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7948
2016-09-20 05:26:40 +00:00
Edward Tomasz Napierala
81eaa5685e Fix -media to not mount ufs with "async"; it doesn't make sense when
there is softupdates.

Suggested by:	imp@
MFC after:	1 month
2016-09-20 04:54:00 +00:00
Edward Tomasz Napierala
921bf145a6 Stop appending "noatime" in the autofs -media map, and instead add it
to auto_master, since all filesystems seem to support it.  It's cleaner
this way, and easier to customize.

MFC after:	1 month
2016-09-20 04:52:01 +00:00
Warner Losh
19b7fe02c4 Document existing practice and be more clear about sys/foo.h files
being alphabetical with sys/param.h or sys/types.h being first. Expand
the example to hopefully make this (slightly) clearer.

Noticed by: cem@
2016-09-20 04:50:53 +00:00