]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoAdd support for SPI-mapped MSI interrupts outside of GICv2m.
Wojciech Macek [Wed, 21 Sep 2016 05:33:18 +0000 (05:33 +0000)]
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

7 years agoAdd support for SPI-mapped MSI interrupts in GICv3.
Wojciech Macek [Wed, 21 Sep 2016 05:22:49 +0000 (05:22 +0000)]
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

7 years agoRegister GICv3 xref.
Wojciech Macek [Wed, 21 Sep 2016 05:15:50 +0000 (05:15 +0000)]
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

7 years agoMove ofw_parse_bootargs to the correct place.
Justin Hibbits [Wed, 21 Sep 2016 03:10:41 +0000 (03:10 +0000)]
Move ofw_parse_bootargs to the correct place.

Also, create a static initial environment, so bootargs can be set from uboot.

7 years agoMove ofw_cpu file to the main files conf file.
Justin Hibbits [Wed, 21 Sep 2016 02:56:57 +0000 (02:56 +0000)]
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.

7 years agoAdd a ofw_parse_bootargs function, and use it for powerpc
Justin Hibbits [Wed, 21 Sep 2016 02:28:39 +0000 (02:28 +0000)]
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

7 years agoAdd yet another QorIQ GPIO compat string.
Justin Hibbits [Wed, 21 Sep 2016 02:27:23 +0000 (02:27 +0000)]
Add yet another QorIQ GPIO compat string.

P1022 boards use the string "fsl,pq3-gpio", which seems to be common in Linux
dts files.

7 years agocxgbe(4): Setup congestion response for T6 rx queues.
Navdeep Parhar [Wed, 21 Sep 2016 00:50:22 +0000 (00:50 +0000)]
cxgbe(4): Setup congestion response for T6 rx queues.

7 years agocxgbe(4): Show wcwr_stats for T6 cards.
Navdeep Parhar [Wed, 21 Sep 2016 00:46:08 +0000 (00:46 +0000)]
cxgbe(4): Show wcwr_stats for T6 cards.

7 years agoProtect ccbq access with devq->send_mtx in the XPT_ABORT handler.
Mark Johnston [Wed, 21 Sep 2016 00:08:42 +0000 (00:08 +0000)]
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

7 years agoelfdump: limit STDIN to no rights rather than closing it
Ed Maste [Tue, 20 Sep 2016 21:38:12 +0000 (21:38 +0000)]
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

7 years agodhclient(8): Enable numbered user class ID option
Conrad Meyer [Tue, 20 Sep 2016 19:21:41 +0000 (19:21 +0000)]
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

7 years agoIf present, honor the USB port mode (host or peripheral) set on DTS, if not,
Luiz Otavio O Souza [Tue, 20 Sep 2016 19:06:58 +0000 (19:06 +0000)]
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)

7 years agonet80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.
Andriy Voskoboinyk [Tue, 20 Sep 2016 18:53:42 +0000 (18:53 +0000)]
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

7 years agoFix periodic scripts when an NFS mount covers a local mount
Alan Somers [Tue, 20 Sep 2016 18:47:33 +0000 (18:47 +0000)]
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

7 years agoReduce code duplication around NDP message handlers in icmp6_input().
Mark Johnston [Tue, 20 Sep 2016 18:08:17 +0000 (18:08 +0000)]
Reduce code duplication around NDP message handlers in icmp6_input().

No functional change intended.

MFC after: 2 weeks

7 years agoAlways pass -m to ld for converting binary files to kernel ELF objects
Ed Maste [Tue, 20 Sep 2016 17:07:14 +0000 (17:07 +0000)]
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

7 years agoPort vnd_test to FreeBSD
Enji Cooper [Tue, 20 Sep 2016 16:40:15 +0000 (16:40 +0000)]
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

7 years agoPort to mknod_test and readdir_test to FreeBSD
Enji Cooper [Tue, 20 Sep 2016 16:37:02 +0000 (16:37 +0000)]
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

7 years agoPort sizes_test and statvfs_test to FreeBSD
Enji Cooper [Tue, 20 Sep 2016 16:31:57 +0000 (16:31 +0000)]
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

7 years agoPort contrib/netbsd-tests/fs/h_funcs.subr to FreeBSD
Enji Cooper [Tue, 20 Sep 2016 16:28:57 +0000 (16:28 +0000)]
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

7 years agoPort vnode_leak_test:main to FreeBSD
Enji Cooper [Tue, 20 Sep 2016 16:27:34 +0000 (16:27 +0000)]
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

7 years agoUse SRCTOP instead of the longhand version for defining the path to contrib/atf
Enji Cooper [Tue, 20 Sep 2016 16:24:22 +0000 (16:24 +0000)]
Use SRCTOP instead of the longhand version for defining the path to contrib/atf

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoSpell alphabetically correctly both in the commit message AND in the
Warner Losh [Tue, 20 Sep 2016 15:14:33 +0000 (15:14 +0000)]
Spell alphabetically correctly both in the commit message AND in the
actual man page. Sigh.

Submitted by: David A Bright and Pedro Giffuni

7 years agobspatch: Remove backwards-compatibility sys/capability.h support
Ed Maste [Tue, 20 Sep 2016 15:13:15 +0000 (15:13 +0000)]
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

7 years agomrsas: update for sys/capability.h rename in r263232
Ed Maste [Tue, 20 Sep 2016 12:59:30 +0000 (12:59 +0000)]
mrsas: update for sys/capability.h rename in r263232

7 years agoauditdistd: update for sys/capability.h rename in r263232
Ed Maste [Tue, 20 Sep 2016 12:58:28 +0000 (12:58 +0000)]
auditdistd: update for sys/capability.h rename in r263232

7 years agohwpmc: remove sys/capability.h backwards compatibility
Ed Maste [Tue, 20 Sep 2016 12:56:03 +0000 (12:56 +0000)]
hwpmc: remove sys/capability.h backwards compatibility

The Capsicum header is installed as sys/capsicum.h in stable/10 as well.

7 years agoAdd driver for PCIe root complex on Annapurna Alpine platform.
Wojciech Macek [Tue, 20 Sep 2016 11:11:06 +0000 (11:11 +0000)]
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

7 years agoMove pmap_p*e_index() inline functions from pmap.c to pmap.h.
Konstantin Belousov [Tue, 20 Sep 2016 09:38:07 +0000 (09:38 +0000)]
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

7 years agoUpdate Annapurna Alpine HAL
Wojciech Macek [Tue, 20 Sep 2016 09:19:22 +0000 (09:19 +0000)]
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

7 years agoFollow up r305988 by removing g_bio_run_task and related code.
Edward Tomasz Napierala [Tue, 20 Sep 2016 09:18:33 +0000 (09:18 +0000)]
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

7 years agohyperv/storvsc: Fix SRB length setting.
Sepherosa Ziehau [Tue, 20 Sep 2016 08:52:45 +0000 (08:52 +0000)]
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

7 years agohyperv/hn: Let the caller of hn_nvs_doinit() do the error logging.
Sepherosa Ziehau [Tue, 20 Sep 2016 05:45:18 +0000 (05:45 +0000)]
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

7 years agohyperv/hn: Fix ifnet hwassist setup.
Sepherosa Ziehau [Tue, 20 Sep 2016 05:26:40 +0000 (05:26 +0000)]
hyperv/hn: Fix ifnet hwassist setup.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7948

7 years agoFix -media to not mount ufs with "async"; it doesn't make sense when
Edward Tomasz Napierala [Tue, 20 Sep 2016 04:54:00 +0000 (04:54 +0000)]
Fix -media to not mount ufs with "async"; it doesn't make sense when
there is softupdates.

Suggested by: imp@
MFC after: 1 month

7 years agoStop appending "noatime" in the autofs -media map, and instead add it
Edward Tomasz Napierala [Tue, 20 Sep 2016 04:52:01 +0000 (04:52 +0000)]
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

7 years agoDocument existing practice and be more clear about sys/foo.h files
Warner Losh [Tue, 20 Sep 2016 04:50:53 +0000 (04:50 +0000)]
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@

7 years agoMake autofs(5) -media map also use "async" and "noatime" for ext2fs(5).
Edward Tomasz Napierala [Tue, 20 Sep 2016 04:33:58 +0000 (04:33 +0000)]
Make autofs(5) -media map also use "async" and "noatime" for ext2fs(5).

Suggested by: pfg@
MFC after: 1 month

7 years agolibdwarf: Add definitions for Apple's DWARF extension attributes.
Mark Johnston [Tue, 20 Sep 2016 00:22:35 +0000 (00:22 +0000)]
libdwarf: Add definitions for Apple's DWARF extension attributes.

Reviewed by: emaste
MFC after: 1 week

7 years ago[iwm] Improve reliability of iwm_release on disassociation a bit.
Imre Vadász [Mon, 19 Sep 2016 22:36:30 +0000 (22:36 +0000)]
[iwm] Improve reliability of iwm_release on disassociation a bit.

* We need to first call ivp->iv_newstate(), to enqueue the deauth/deassoc
  mgmt frame, then flush the tx queue, before actually calling
  iwm_release().

* cycling a wlan connection via wpa_cli frontend to wpa_supplicant, by
  issuing disconnect and reconnect commandos works quite well.
  (There is still an issue when disconnecting/reconnecting too quickly)

* Reassociating or roaming via wpa_supplicant is still broken.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7943

7 years ago[iwm] Remove dead fw_totlen from struct iwm_fw_sects; clean up struct iwm_nvm_data.
Imre Vadász [Mon, 19 Sep 2016 22:26:37 +0000 (22:26 +0000)]
[iwm] Remove dead fw_totlen from struct iwm_fw_sects; clean up struct iwm_nvm_data.

* No functional change, none of these values were ever read.

* The values removed from struct iwm_nvm_data are only used for old dvm
  devices in Linux iwlwifi, and irrelevant to iwm hence.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7945

7 years ago[iwm] Use IWM_DEFAULT_SCAN_CHANNELS define as default for sc_capa_n_scan_channels.
Imre Vadász [Mon, 19 Sep 2016 22:23:46 +0000 (22:23 +0000)]
[iwm] Use IWM_DEFAULT_SCAN_CHANNELS define as default for sc_capa_n_scan_channels.

Approved by: adrian (mentor)
Obtained from: Linux iwlwifi
Differential Revision: https://reviews.freebsd.org/D7938

7 years ago[iwm] Remove deprecated scan API definitions.
Imre Vadász [Mon, 19 Sep 2016 22:20:46 +0000 (22:20 +0000)]
[iwm] Remove deprecated scan API definitions.

* This removes deprecated scan API definitions, which have been unused
  since the upgrade to version 16 firmware in change r303327.

* Part of this change matches the header-file changes in Linux git commit
  1f9403863c080478ad78247c89b018e95bdfb027.

* No functional change.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7937

7 years ago[iwm] Remove wrappers around iwm_dma_contig_free() calls.
Imre Vadász [Mon, 19 Sep 2016 22:16:03 +0000 (22:16 +0000)]
[iwm] Remove wrappers around iwm_dma_contig_free() calls.

No functional changes.

Inspired by: OpenBSD
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7933

7 years ago[iwm] Fix iwm_poll_bit() error value check in iwm_attach().
Imre Vadász [Mon, 19 Sep 2016 22:13:08 +0000 (22:13 +0000)]
[iwm] Fix iwm_poll_bit() error value check in iwm_attach().

The iwm(4) iwm_poll_bit() function returns 1 on success, and 0 on failure,
whereas the iwl_poll_bit() in Linux iwlwifi returns < 0 on failure.

So the (ret < 0) check ended up ignoring any error returned by
iwm_poll_bit().

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7932

7 years ago[iwm] Fix off-by-one check in iwm_read_firmware().
Imre Vadász [Mon, 19 Sep 2016 22:11:34 +0000 (22:11 +0000)]
[iwm] Fix off-by-one check in iwm_read_firmware().

This fixes a potential buffer overrun in the firmware parsing code.

Reported by: Coverity
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7931

7 years ago[iwm] Remove unused field from iwm_rx_data. Use uint32_t instead of enum type.
Imre Vadász [Mon, 19 Sep 2016 22:08:47 +0000 (22:08 +0000)]
[iwm] Remove unused field from iwm_rx_data. Use uint32_t instead of enum type.

The wantresp field in struct iwm_rx_data has never been used for anything,
so we can just delete it.

Apparently struct iwm_sf_cfg_cmd was compiled correctly (using a 32bit
value to represent the enum), but it still seems like a very bad idea to use
an enum type in a __packed struct.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7930

7 years ago[iwm] Use htole16 for policy field in struct iwm_time_event_cmd_v2.
Imre Vadász [Mon, 19 Sep 2016 22:06:00 +0000 (22:06 +0000)]
[iwm] Use htole16 for policy field in struct iwm_time_event_cmd_v2.

The htole32 was working fine for little-endian machines, but would have
been broken on big-endian.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7929

7 years agoMove sys/capsicum.h includes after types.h or param.h
Conrad Meyer [Mon, 19 Sep 2016 20:43:03 +0000 (20:43 +0000)]
Move sys/capsicum.h includes after types.h or param.h

This is not actually documented or even implied in style(9).  Make the change
to match convention.  Someone should document this convention in style(9).

Reported by: jhb
Sponsored by: EMC Dell Isilon

7 years agorevert unintended change from r305994
Ed Maste [Mon, 19 Sep 2016 18:45:57 +0000 (18:45 +0000)]
revert unintended change from r305994

7 years agoCatch up to sys/capability.h rename to sys/capsicum.h in r263232
Ed Maste [Mon, 19 Sep 2016 18:44:43 +0000 (18:44 +0000)]
Catch up to sys/capability.h rename to sys/capsicum.h in r263232

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agomount(1): Simplify by using asprintf(3)
Pedro F. Giffuni [Mon, 19 Sep 2016 18:42:58 +0000 (18:42 +0000)]
mount(1): Simplify by using asprintf(3)

Instead of strlen() + malloc() + snprintf, just use asprintf().
No functional change.

Obtained from: OpenBSD (CVS Rev. 1.67)

7 years agodev/usb: add USB IDs for Realtek 802.11ac wireless adapters.
Andriy Voskoboinyk [Mon, 19 Sep 2016 18:36:26 +0000 (18:36 +0000)]
dev/usb: add USB IDs for Realtek 802.11ac wireless adapters.

They are will be used by the updated rtwn(4) / urtwn(4) driver.

Suggested by: adrian

7 years agohexdump(1): Simplify by using asprintf(3)
Pedro F. Giffuni [Mon, 19 Sep 2016 18:35:22 +0000 (18:35 +0000)]
hexdump(1): Simplify by using asprintf(3)

Instead of strlen() + calloc() + snprintf, just use asprintf().
No functional change.

Obtained from: OpenBSD (CVS Rev. 1.22)

7 years agotcpdump: remove sys/capability.h #include
Ed Maste [Mon, 19 Sep 2016 17:51:56 +0000 (17:51 +0000)]
tcpdump: remove sys/capability.h #include

sys/capability.h is just a backwards compatibility wrapper around
sys/capsicum.h, which is already #included.

7 years agoRemove unused bio_taskqueue().
Edward Tomasz Napierala [Mon, 19 Sep 2016 17:46:15 +0000 (17:46 +0000)]
Remove unused bio_taskqueue().

MFC after: 1 month

7 years agoSync in latest vDSOs from upstream.
Ed Schouten [Mon, 19 Sep 2016 17:31:05 +0000 (17:31 +0000)]
Sync in latest vDSOs from upstream.

- Use conditional instruction to simplify the ARMv6 vDSO. This means
  that we no longer perform any branching. In the failure case, we
  simply slide over the assignments of the return values.

  The vDSO could be improved even further by using stmia to do
  assignments in parallel. Unfortunately, the script used to generate
  these is not smart enough for that (yet).

  Spotted by: andrew@.

- Make the style of the i686 vDSO more similar to the others by using
  decimal literals.

7 years agocxgbe(4): Fixes to wrq stats.
Navdeep Parhar [Mon, 19 Sep 2016 17:16:51 +0000 (17:16 +0000)]
cxgbe(4): Fixes to wrq stats.

- Increment tx_wrs_copied in the correct place.
- Add tx_wrs_sspace to the sysctl MIB.

Sponsored by: Chelsio Communications

7 years agoindent(1): Capsicumify
Conrad Meyer [Mon, 19 Sep 2016 16:16:14 +0000 (16:16 +0000)]
indent(1): Capsicumify

This is a nice and trivial program for sandboxing.  One input file, one
output file.

Reviewed by: pfg
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D7920

7 years agotr(1): Capsicumify
Conrad Meyer [Mon, 19 Sep 2016 16:14:38 +0000 (16:14 +0000)]
tr(1): Capsicumify

This is a straightforward single input, single output program for
capsicum.

Reviewed by: bapt
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D7928

7 years agocmp(1): Capsicumify
Conrad Meyer [Mon, 19 Sep 2016 16:13:00 +0000 (16:13 +0000)]
cmp(1): Capsicumify

Reviewed by: allanjude, bapt, oshogbo
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D7912

7 years agouefisign: Remove backwards-compatibility sys/capability.h support
Ed Maste [Mon, 19 Sep 2016 16:07:32 +0000 (16:07 +0000)]
uefisign: Remove backwards-compatibility sys/capability.h support

uefisign previously included sys/capability.h or sys/capsicum.h based
on __FreeBSD_version in order to facilitate development on the stable
branch. The Capsicum header is now installed as sys/capsicum.h in
stable/10 and FreeBSD 10.3, so there's no need for the backwards
compatibility support.

Reviewed by: trasz
Sponsored by: The FreeBSD Foundation

7 years agoDetect x2APIC mode on boot and obey it.
Konstantin Belousov [Mon, 19 Sep 2016 15:58:45 +0000 (15:58 +0000)]
Detect x2APIC mode on boot and obey it.

If BIOS performed hand-off to OS with BSP LAPIC in the x2APIC mode,
system usually consumes such configuration without a notice, since
x2APIC is turned on by OS if possible (nop).  But if BIOS
simultaneously requested OS to not use x2APIC, code assumption that
that xAPIC is active breaks.

In my opinion, we cannot safely turn off x2APIC if control is passed
in this mode.  Make madt.c ignore user or BIOS requests to turn x2APIC
off, and do not check the x2APIC black list.  Just trust the config
and try to continue, giving a warning in dmesg.

Reported and tested by: Slawa Olhovchenkov <slw@zxy.spb.ru> (previous version)
Diagnosed by and discussed with: avg
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoBe more strict when selecting between snapshot/regular mount.
Konstantin Belousov [Mon, 19 Sep 2016 15:58:33 +0000 (15:58 +0000)]
Be more strict when selecting between snapshot/regular mount.

Reclaimed vnode type is VBAD, so succesful comparision like
devvp->v_type != VREG does not imply that the devvp references
snapshot, it might be due to a reclaimed vnode.  Explicitely check the
vnode type.

In the the most important case of ffs_blkfree(), the devfs vnode is
locked and its type is stable.  In other cases, if the vnode is
reclaimed right after the check, hopefully the buffer methods return
right error codes.

Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoAttach the cortex strings library to the build. Only a subset of functions
Andrew Turner [Mon, 19 Sep 2016 15:08:03 +0000 (15:08 +0000)]
Attach the cortex strings library to the build. Only a subset of functions
have been added as some don't seem to be improvements over the libc C
implementation.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoFix the asm on the memchr and strchr functions.
Andrew Turner [Mon, 19 Sep 2016 14:36:16 +0000 (14:36 +0000)]
Fix the asm on the memchr and strchr functions.
Add an alias from index to strchr as is done in the libc C implementation.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoImport the Linaro Cortex Strings library into contrib.
Andrew Turner [Mon, 19 Sep 2016 13:12:09 +0000 (13:12 +0000)]
Import the Linaro Cortex Strings library into contrib.

Sponsored by: The FreeBSD Foundation

7 years agoRemove change accidentally committed via r305963 for upcoming tests/sys/fs/...
Enji Cooper [Mon, 19 Sep 2016 09:15:12 +0000 (09:15 +0000)]
Remove change accidentally committed via r305963 for upcoming tests/sys/fs/...
work

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoMake autofs use the "noatime" flag for msdosfs, ntfs, and ufs
Edward Tomasz Napierala [Mon, 19 Sep 2016 08:55:36 +0000 (08:55 +0000)]
Make autofs use the "noatime" flag for msdosfs, ntfs, and ufs
filesystems mounted on /media.

MFC after: 1 month

7 years agoMake autofs use the "async" flag for msdosfs and ufs filesystems mounted
Edward Tomasz Napierala [Mon, 19 Sep 2016 08:51:27 +0000 (08:51 +0000)]
Make autofs use the "async" flag for msdosfs and ufs filesystems mounted
on /media.

MFC after: 1 month

7 years agohyperv/hn: Allow RSS capability flipping upon attach/reinit.
Sepherosa Ziehau [Mon, 19 Sep 2016 07:47:56 +0000 (07:47 +0000)]
hyperv/hn: Allow RSS capability flipping upon attach/reinit.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7927

7 years agohyperv/hn: Stringent RSS sysctl checks
Sepherosa Ziehau [Mon, 19 Sep 2016 07:39:42 +0000 (07:39 +0000)]
hyperv/hn: Stringent RSS sysctl checks

- Don't change RNDIS RSS configuration for RSS key sysctl, if the
  interface is not capable of RSS yet.
- Don't change RSS indirect table (both cached one and RNDIS RSS
  configuration), if the interface is not capable of RSS yet.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7924

7 years agohyperv/hn: Don't allow MTU change, if it is not supported by the NVS.
Sepherosa Ziehau [Mon, 19 Sep 2016 07:32:08 +0000 (07:32 +0000)]
hyperv/hn: Don't allow MTU change, if it is not supported by the NVS.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7923

7 years agohyperv/hn: Save capabilities for later use.
Sepherosa Ziehau [Mon, 19 Sep 2016 07:17:43 +0000 (07:17 +0000)]
hyperv/hn: Save capabilities for later use.

And don't allow capability changes during reinitialization, which
breaks too much static configuration.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7922

7 years agoReindent TESTSDIR definition for consistency/readability
Enji Cooper [Mon, 19 Sep 2016 07:07:55 +0000 (07:07 +0000)]
Reindent TESTSDIR definition for consistency/readability

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agohyperv/hn: Don't allow NVS and NDIS version change upon reinitailization
Sepherosa Ziehau [Mon, 19 Sep 2016 07:07:23 +0000 (07:07 +0000)]
hyperv/hn: Don't allow NVS and NDIS version change upon reinitailization

NVS and NDIS version change would break too much assumption and static
configuration.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7919

7 years agoRe-add PACKAGE=> tests to lib/libc/tests/net/getaddrinfo/Makefile and add
Enji Cooper [Mon, 19 Sep 2016 06:59:17 +0000 (06:59 +0000)]
Re-add PACKAGE=> tests to lib/libc/tests/net/getaddrinfo/Makefile and add
it to lib/libc/tests/sys/Makefile [*]

Even though make -VPACKAGE and make -n install seem to do the right thing,
the effects are a bit different, depending on the build host.

MFC after: 1 week
Obtained from: HardenedBSD (af602f0db) [*]
Reported by: Oliver Pinter <oliver.pinter@hardenedbsd.org> [*]
Sponsored by: Dell EMC Isilon

7 years agohyperv/hn: Apply RSS indirect table fixup before configure RNDIS RSS.
Sepherosa Ziehau [Mon, 19 Sep 2016 06:46:22 +0000 (06:46 +0000)]
hyperv/hn: Apply RSS indirect table fixup before configure RNDIS RSS.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7916

7 years agoRevert capsicum support
Baptiste Daroussin [Mon, 19 Sep 2016 06:39:11 +0000 (06:39 +0000)]
Revert capsicum support

In some corner case VFS lookup is not working and I do not have time to debug
it for now.

7 years agoRemove expected failure for :basic (effectively reverting r305007, r305031)
Enji Cooper [Mon, 19 Sep 2016 06:39:08 +0000 (06:39 +0000)]
Remove expected failure for :basic (effectively reverting r305007, r305031)

This no longer fails as of r305952

PR: 212193
Sponsored by: Dell EMC Isilon

7 years agoFix typo introduced in r305949 with the stable/10 bootstrapping logic
Enji Cooper [Mon, 19 Sep 2016 03:02:43 +0000 (03:02 +0000)]
Fix typo introduced in r305949 with the stable/10 bootstrapping logic

The header is sys/capability.h, not sys/capabilities.h

X-MFC with: r305949
Pointyhat to: bapt
Reported by: allanjude, Jenkins
Sponsored by:  Dell EMC Isilon

7 years agoAdd manpage for rctl_* system calls
Eric Badger [Mon, 19 Sep 2016 02:25:30 +0000 (02:25 +0000)]
Add manpage for rctl_* system calls

Reviewed by: trasz, wblock
Approved by: kib (mentor)
MFC after: 3 days
Sponsored by: Dell Technologies
Differential Revision: https://reviews.freebsd.org/D7877

7 years agoRegen.
Konstantin Belousov [Sun, 18 Sep 2016 22:03:26 +0000 (22:03 +0000)]
Regen.

7 years agoAdd compat32 support for capsicum.
Konstantin Belousov [Sun, 18 Sep 2016 22:03:07 +0000 (22:03 +0000)]
Add compat32 support for capsicum.

Reviewed by: bapt, emaste
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D7942

7 years agoSplit bcm_mipscore.c into bcm_bmips (BMIPS32/BMIPS3300) and bcm_mips74k
Landon J. Fuller [Sun, 18 Sep 2016 21:28:09 +0000 (21:28 +0000)]
Split bcm_mipscore.c into bcm_bmips (BMIPS32/BMIPS3300) and bcm_mips74k
drivers.

The BMIPS32/BMIPS3300 cores use a register layout distinct from the MIPS74K
core, and are only found on siba(4) devices.

Reviewed by: mizhka
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7791

7 years agoReplace dirname(3) by a copy that complies to POSIX.
Ed Schouten [Sun, 18 Sep 2016 20:47:55 +0000 (20:47 +0000)]
Replace dirname(3) by a copy that complies to POSIX.

It turns out that the path normalization that our brand new copy of
dirname(3) does is actually not allowed by the draft version of the
upcoming version of POSIX. It has to behave identically to the
dirname(1) utility.

This change replaces our new dirname(3) implementation by yet another
version that doesn't implement the path normalization logic; it merely
looks for the end of the directory name and overwrites that with a null
byte.

More details: See note #3370 at http://austingroupbugs.net/view.php?id=1073

PR: 212193
Reviewed by: emaste, jilles
Differential Revision: https://reviews.freebsd.org/D7790

7 years agoelfdump: adjust stdout/stderr capabilities
Ed Maste [Sun, 18 Sep 2016 20:23:26 +0000 (20:23 +0000)]
elfdump: adjust stdout/stderr capabilities

stdio uses fstat and the TIOCGETA ioctl. Also collapse the
cap_rights_limit and new cap_ioctls_limit calls into one if statement.
Errors here are not actionable by the user and distinguishing stdout
from stderr doesn't really have value.

Reported by: kib
Reviewed by: allanjude, bapt
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7944

7 years agoSimplify the fix for bootstrap tools
Baptiste Daroussin [Sun, 18 Sep 2016 19:16:48 +0000 (19:16 +0000)]
Simplify the fix for bootstrap tools

building head is not supported from prior to stable/10 where sys/capsicum.h was
named sys/capabilities.h

Reported by: kib

7 years agoFix building as bootstrap tools on pre-capsicum.h systems
Baptiste Daroussin [Sun, 18 Sep 2016 18:49:18 +0000 (18:49 +0000)]
Fix building as bootstrap tools on pre-capsicum.h systems

7 years agoAdd comment for the closing guard.
Konstantin Belousov [Sun, 18 Sep 2016 18:40:27 +0000 (18:40 +0000)]
Add comment for the closing guard.

Requested by: tsoome
MFC after: 1 week

7 years agoSperify that users can find rcs and rcs57 in ports
Baptiste Daroussin [Sun, 18 Sep 2016 18:27:28 +0000 (18:27 +0000)]
Sperify that users can find rcs and rcs57 in ports

Reported by: cy

7 years agoBetter error checking
Baptiste Daroussin [Sun, 18 Sep 2016 18:03:06 +0000 (18:03 +0000)]
Better error checking

if getcwd fails: just ignore it and do not try to adding to the list of possible
path where to find the files.

if fdopen fails, warn and return NULL the rest of the code knows how to deal
with it

Reported by: oshogbo

7 years agostyle(9) fix
Baptiste Daroussin [Sun, 18 Sep 2016 17:56:14 +0000 (17:56 +0000)]
style(9) fix

Reported by: oshogbo

7 years agoUtilize pmap.h names for constants and types used to construct EFI
Konstantin Belousov [Sun, 18 Sep 2016 17:41:16 +0000 (17:41 +0000)]
Utilize pmap.h names for constants and types used to construct EFI
trampoline page table.  Also do some style cleanup.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D7934

7 years agoConsolidate four efi_next_descriptor() definitions.
Konstantin Belousov [Sun, 18 Sep 2016 17:38:02 +0000 (17:38 +0000)]
Consolidate four efi_next_descriptor() definitions.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd double-inclusion protection.
Konstantin Belousov [Sun, 18 Sep 2016 17:35:24 +0000 (17:35 +0000)]
Add double-inclusion protection.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoMove opcode rewriter init and destroy handlers into non-VENT code.
Andrey V. Elsukov [Sun, 18 Sep 2016 17:35:17 +0000 (17:35 +0000)]
Move opcode rewriter init and destroy handlers into non-VENT code.

PR: 212576,212649,212077
Submitted by: John Zielinski
MFC after: 1 week

7 years agoRemove trailing space.
Konstantin Belousov [Sun, 18 Sep 2016 17:33:49 +0000 (17:33 +0000)]
Remove trailing space.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoFix badly computed register/stack offset of system call output arguments.
Ed Schouten [Sun, 18 Sep 2016 17:23:53 +0000 (17:23 +0000)]
Fix badly computed register/stack offset of system call output arguments.

Bugs in the Python code used to generate this vDSO caused us to
miscompute the register numbers/stack offsets at which addresses of the
system call output arguments were stored.

Together with some other patches, this vDSO allows us to make all of the
cloudlibc unit tests pass.

Obtained from: https://github.com/NuxiNL/cloudabi