]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoDon't panic if it's not a TI chip, this code can be called when it is not.
Olivier Houchard [Sat, 19 Nov 2016 15:35:40 +0000 (15:35 +0000)]
Don't panic if it's not a TI chip, this code can be called when it is not.

7 years agoDon't attempt to get the chip revision if it's not a supported TI chip
Olivier Houchard [Sat, 19 Nov 2016 15:35:10 +0000 (15:35 +0000)]
Don't attempt to get the chip revision if it's not a supported TI chip

7 years agoIdentify Ingenic CPUs.
Ruslan Bukin [Sat, 19 Nov 2016 15:10:10 +0000 (15:10 +0000)]
Identify Ingenic CPUs.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoAdd Ingenic X1000 DTS files (unofficial).
Ruslan Bukin [Sat, 19 Nov 2016 15:03:49 +0000 (15:03 +0000)]
Add Ingenic X1000 DTS files (unofficial).

This is based on JZ4780 due to missing original X1000 parts.

Sponsored by: DARPA, AFRL

7 years agoOn H3, initialize alarm and shutdown trip points and do temperature
Jared McNeill [Sat, 19 Nov 2016 14:56:22 +0000 (14:56 +0000)]
On H3, initialize alarm and shutdown trip points and do temperature
conversion as it is done in the BSP.

7 years agoEnsure that TCP state changes to state-closing are reported via dtrace.
Michael Tuexen [Sat, 19 Nov 2016 14:45:08 +0000 (14:45 +0000)]
Ensure that TCP state changes to state-closing are reported via dtrace.
This does not cover state changes from TIME-WAIT.

Reviewed by: gnn
MFC after: 3 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D8443

7 years agoMake fdt_is_compatible a static function. It's only used in fdt_common.c.
Andrew Turner [Sat, 19 Nov 2016 13:57:21 +0000 (13:57 +0000)]
Make fdt_is_compatible a static function. It's only used in fdt_common.c.

Sponsored by: ABT Systems Ltd

7 years agoMove the pandaboard initialization from the probe to the attach method.
Olivier Houchard [Sat, 19 Nov 2016 13:11:03 +0000 (13:11 +0000)]
Move the pandaboard initialization from the probe to the attach method.
Use ofw_bus_node_is_compatible instead of fdt_is_compatible, as the
later is deprecated.

Suggested by: andrew

7 years agolsdev device name section headers should be printed by dv_print callback.
Toomas Soome [Sat, 19 Nov 2016 08:54:21 +0000 (08:54 +0000)]
lsdev device name section headers should be printed by dv_print callback.

lsdev command does walk over devsw list, prints list element name and
will use dv_print() callback to print the device list.
Unfortunately this approach will add unneeded noise when there are no
particular devices detected.

To remove "empty" device section headers, the dv_print() callback
should print the header instead.

In addition, fixed dv_print callback for md module.

Reviewed by: imp
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D8551

7 years agozfs: fix up after the removal of PG_CACHED pages in r308691
Andriy Gapon [Sat, 19 Nov 2016 08:12:57 +0000 (08:12 +0000)]
zfs: fix up after the removal of PG_CACHED pages in r308691

PR: 214629
Reported by: mshirk@daemon-security.com
Reviewed by: alc
Tested by: Shawn Webb <shawn.webb@hardenedbsd.org>
X-MFC with: 308691

7 years agoFor RTL8812AU:
Kevin Lo [Sat, 19 Nov 2016 07:28:00 +0000 (07:28 +0000)]
For RTL8812AU:
- The Tx power (diff) values should be signed
- Fix an off by one error when reading Tx power (diff) values

Reviewed by: avos, adrian
Differential Revision: https://reviews.freebsd.org/D8571

7 years agolocale: fix display of "grouping" and "mon_grouping" values
Eric van Gyzen [Sat, 19 Nov 2016 02:09:58 +0000 (02:09 +0000)]
locale: fix display of "grouping" and "mon_grouping" values

The "grouping" and "mon_grouping" values are arrays of one-byte
integers, not arrays of ASCII characters.  Display them in a format
similar to GNU and MacOS.

MFC after: 3 days
Sponsored by: Dell EMC

7 years ago[net80211] handle hardware encryption offload in the receive path
Adrian Chadd [Sat, 19 Nov 2016 02:00:24 +0000 (02:00 +0000)]
[net80211] handle hardware encryption offload in the receive path

* teach the crypto modules about receive offload - although I have
  to do some further reviewing in places where we /can't/ have an RX key
* teach the RX data path about receive offload encryption - check the flag,
  handle NULL key, do decap and checking as appropriate.

Tested:

* iwn(4), STA mode
* ath(4), STA and AP mode
* ath10k port, STA mode (hardware encryption)

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D8533

7 years agoResolv the remaining conflicting symbols between omap4 and am335x, and
Olivier Houchard [Sat, 19 Nov 2016 01:51:56 +0000 (01:51 +0000)]
Resolv the remaining conflicting symbols between omap4 and am335x, and
add omap4/pandaboard into the GENERIC kernel.

7 years agoMFamd64: Various fatal page fault fixes.
John Baldwin [Sat, 19 Nov 2016 01:36:44 +0000 (01:36 +0000)]
MFamd64: Various fatal page fault fixes.

- If a page fault is triggered due to reserved bits in a PTE, treat it
  as a fatal fault and panic.
- If PG_NX is in use, report whether a fatal page fault is due to an
  instruction fetch or a data access.
- If a fatal page fault is due to reserved bits in a PTE, report that as
  the page fault type rather than a protection violation.

MFC after: 1 month

7 years agoReport page faults due to reserved bits in PTEs as a separate fault type.
John Baldwin [Sat, 19 Nov 2016 01:34:12 +0000 (01:34 +0000)]
Report page faults due to reserved bits in PTEs as a separate fault type.

Rather than reporting a page fault due to a bad PTE as a protection
violation with the "rsv" flag, treat these faults as a separate type of
fault altogether.

MFC after: 1 month

7 years agoDon't assume we're running on a pandaboard if the pandaboard-specific
Olivier Houchard [Sat, 19 Nov 2016 00:55:46 +0000 (00:55 +0000)]
Don't assume we're running on a pandaboard if the pandaboard-specific
code is compiled in, use FDT to detect it instead.

7 years agoGuess the TI chip based on the PLATFORM infos, instead of relying on the
Olivier Houchard [Fri, 18 Nov 2016 23:48:20 +0000 (23:48 +0000)]
Guess the TI chip based on the PLATFORM infos, instead of relying on the
kernel config file.

7 years agoFix buildworld
Justin Hibbits [Fri, 18 Nov 2016 22:59:33 +0000 (22:59 +0000)]
Fix buildworld

Change the pv_tracked flag to an int, just in case userspace decides to include
this file and defines BOOKE.

Guard this block from unintentional inclusion with ifdef BOOKE.

Reported by: emaste

7 years agoConvert the omap4 code to use PLATFORM_SMP.
Olivier Houchard [Fri, 18 Nov 2016 22:58:47 +0000 (22:58 +0000)]
Convert the omap4 code to use PLATFORM_SMP.

7 years agoCheck link status after init
Stephen Hurd [Fri, 18 Nov 2016 21:18:51 +0000 (21:18 +0000)]
Check link status after init

Because link state change events aren't enabled until the end of init(),
the initial link up event could be missed.  Check the current media status
immediately after enabling the default completion ring interrupt.

Approved by: sbruno
MFC after: 12 days
Sponsored by: Broadcom Limited

7 years ago[ifconfig] remove now duplicate IEEE80211_C_BITS definition; it's now in _ieee80211.h .
Adrian Chadd [Fri, 18 Nov 2016 21:12:36 +0000 (21:12 +0000)]
[ifconfig] remove now duplicate IEEE80211_C_BITS definition; it's now in _ieee80211.h .

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D8553

7 years ago[net80211] shuffle IEEE80211_C and HTC bits over to _ieee80211.h so userland can...
Adrian Chadd [Fri, 18 Nov 2016 21:12:13 +0000 (21:12 +0000)]
[net80211] shuffle IEEE80211_C and HTC bits over to _ieee80211.h so userland can use this.

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D8553

7 years agoCapsicum support for dd(1)
Bartek Rutkowski [Fri, 18 Nov 2016 21:09:57 +0000 (21:09 +0000)]
Capsicum support for dd(1)

Adds Capsicum sandboxing to dd utility.

Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com>
Reviewed by: allanjude, emaste, oshogbo
Approved by: oshogbo
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D8543

7 years agoWe need to lookup locale when command line arguments
Hajimu UMEMOTO [Fri, 18 Nov 2016 17:18:05 +0000 (17:18 +0000)]
We need to lookup locale when command line arguments
are specified, as well.
MFC after: 1 week

7 years agoLookup locale when print all keywords as well.
Hajimu UMEMOTO [Fri, 18 Nov 2016 16:48:37 +0000 (16:48 +0000)]
Lookup locale when print all keywords as well.

Reported by: dumbbell
Reviewed by: dumbbell
MFC after: 1 week

7 years agoSubject: [PATCH] Pass MACHINE_ARCH on command line for MIPS kernels.
Alexander Kabaev [Fri, 18 Nov 2016 16:23:31 +0000 (16:23 +0000)]
Subject: [PATCH] Pass MACHINE_ARCH on command line for MIPS kernels.

While there, make param.h guess proper MACHINE_ARCH on hardfloat targets
correctly as well, so tools like bmake can get their defaults right.
This does not help the kernel case, since we compile them with forced
-msoft-float and need to override an incorrect guess by param.h.

Reviewed by: br
Differential Revision: https://reviews.freebsd.org/D8574

7 years agoSpeed up pw operations that edit /etc/group or /etc/passwd
Alan Somers [Fri, 18 Nov 2016 16:07:08 +0000 (16:07 +0000)]
Speed up pw operations that edit /etc/group or /etc/passwd

r285050 fixed a bug in pw that could lead to /etc/passwd or /etc/group
corruption on power loss. However, it fixed it by opening those files with
O_SYNC, which is very slow, especially on ZFS. This change replaces O_SYNC
with appropriately placed fsync()s instead, which is much faster. Using a
ZFS tmpdir, the time to run pw's kyua tests drops from 245s to 35s.

Reviewed by: allanjude, bapt, vangyzen, garga
Tested on pfSense by: garga
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8319

7 years ago[mips/ar531x] code cleanup, non-INTRNG support
Michael Zhilin [Fri, 18 Nov 2016 14:06:29 +0000 (14:06 +0000)]
[mips/ar531x] code cleanup, non-INTRNG support

This commit improves code styles like:
 - removing commented code
 - format comments as C-style
 - add spaces after #define-s

It also bring ability to build kernel without INTRNG and remove RedBoot dependency.

Tested on FON2201

Submitted by: Hiroki Sato <yamori813@yahoo.co.jp>
Reviewed by: adrian, mizhka
Approved by: adrian(mentor)
Differential Revision: https://reviews.freebsd.org/D8557

7 years agofix share/man/man4/Makefile for hv_ata_pci_disengage.4
Dexuan Cui [Fri, 18 Nov 2016 08:15:45 +0000 (08:15 +0000)]
fix share/man/man4/Makefile for hv_ata_pci_disengage.4

We need to remove the line since we removed the related manual just now.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 1 week
Sponsored by: Microsoft

7 years agoremove the hv_ata_pci_disengage(4) manual
Dexuan Cui [Fri, 18 Nov 2016 07:36:00 +0000 (07:36 +0000)]
remove the hv_ata_pci_disengage(4) manual

A few months ago, we removed the driver, which was not necessary any longer.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 1 week
Sponsored by: Microsoft

7 years agoupdate the hv_vmbus(4) manual by adding a dependency on pci
Dexuan Cui [Fri, 18 Nov 2016 07:27:41 +0000 (07:27 +0000)]
update the hv_vmbus(4) manual by adding a dependency on pci

We enhanced the vmbus driver to support PCIe pass-through recently.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 1 week
Sponsored by: Microsoft

7 years agohyperv/pcib: change the file name: pcib.c -> vmbus_pcib.c
Dexuan Cui [Fri, 18 Nov 2016 06:44:18 +0000 (06:44 +0000)]
hyperv/pcib: change the file name: pcib.c -> vmbus_pcib.c

This makes the file name and the variable naming in the file consistent.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 1 week
Sponsored by: Microsoft

7 years agohyperv/vmbus,pcib: Add MODULE_DEPEND on pci
Dexuan Cui [Fri, 18 Nov 2016 06:24:22 +0000 (06:24 +0000)]
hyperv/vmbus,pcib: Add MODULE_DEPEND on pci

We'd better add this dependency explicitly, though usually the pci
driver is built into the kernel by default.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 1 week
Sponsored by: Microsoft

7 years agohyperv/pcib: Fix the build for some kernel configs
Dexuan Cui [Fri, 18 Nov 2016 05:33:01 +0000 (05:33 +0000)]
hyperv/pcib: Fix the build for some kernel configs

Add the dependency on pci explicitly for the pcib and vmbus drivers.
The related Makefiles are updated accordingly too.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 1 week
Sponsored by: Microsoft

7 years agoiflib updates and fixes:
Sean Bruno [Fri, 18 Nov 2016 04:19:21 +0000 (04:19 +0000)]
iflib updates and fixes:
-    reset gen on down
-    initialize admin task statically
-    drain mp_ring on down
-    don't drop context lock on stop
-    reset error stats on down
-    fix typo in min_latency sysctl
-    return ENOBUFS from if_transmit if the driver isn't running or the link is down

Submitted by: mmacy@nextbsd.org
Reviewed by: shurd
MFC after: 2 days
Sponsored by: Isilon and Limelight Networks
Differential Revision: https://reviews.freebsd.org/D8558

7 years agoSupport fetching RFLAGS in fasttrap_getreg().
Mark Johnston [Fri, 18 Nov 2016 03:11:11 +0000 (03:11 +0000)]
Support fetching RFLAGS in fasttrap_getreg().

MFC after: 1 week

7 years agoAdd a dtrace script for collecting schedgraph data
Ryan Stone [Fri, 18 Nov 2016 02:29:09 +0000 (02:29 +0000)]
Add a dtrace script for collecting schedgraph data

7 years agoIf FreeBSD source tree is a subproject of a bigger project, then .git or
Gleb Smirnoff [Fri, 18 Nov 2016 00:13:30 +0000 (00:13 +0000)]
If FreeBSD source tree is a subproject of a bigger project, then .git or
.hg may reside above FreeBSD sources root.  Provide function findvcs()
that will climb up and seek for presence of a VCS directory.

Reviewed by: imp (earlier version of the patch)

7 years agoCleanup some leftovers from '-s' removal in r302792.
Bryan Drewery [Thu, 17 Nov 2016 23:16:56 +0000 (23:16 +0000)]
Cleanup some leftovers from '-s' removal in r302792.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoAdd missing newline in error mesage
Stephen Hurd [Thu, 17 Nov 2016 23:05:34 +0000 (23:05 +0000)]
Add missing newline in error mesage

Approved by: davidch
MFC after: 13 days
Sponsored by: Broadcom Corporation

7 years agorc.subr: Swap checks so we only fork sysctl if *_oomprotect is set.
Jilles Tjoelker [Thu, 17 Nov 2016 22:49:51 +0000 (22:49 +0000)]
rc.subr: Swap checks so we only fork sysctl if *_oomprotect is set.

7 years ago[net80211] Don't check bgscanidle setting in net80211 for full-offload scan.
Imre Vadász [Thu, 17 Nov 2016 21:52:00 +0000 (21:52 +0000)]
[net80211] Don't check bgscanidle setting in net80211 for full-offload scan.

If full-offload scan is used, the NIC driver (or rather the firmware of
the NIC) should take care of interrupting and continuing the background
scan. So net80211 should ignore the vap->iv_bgscanidle setting then, instead
the NIC driver might look at this setting and pass it on to the firmware
in some way if possible.

Since full-offload scans won't be explicitly interrupted by net80211, it
also doesn't really make sense to check the vap->iv_bgscanidle condition
in that case, before starting a background scan. If the NIC driver
advertises background scan support and full-offload scanning, the firmware
should be able to execute that scan without interfering too much with our
data traffic.

Reviewed by: adrian, avos
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D8539

7 years agoAdd flag SF_USER_READAHEAD to sendfile(2). When specified, the syscall won't
Gleb Smirnoff [Thu, 17 Nov 2016 21:36:18 +0000 (21:36 +0000)]
Add flag SF_USER_READAHEAD to sendfile(2).  When specified, the syscall won't
do any speculations about readahead, and use exactly the amount of readahead
specified by user.  E.g. setting SF_FLAGS(0, SF_USER_READAHEAD) will guarantee
that no readahead at all will be performed.

7 years agoUse bogus_page to properly reduce number of I/Os in sendfile(2). The new
Gleb Smirnoff [Thu, 17 Nov 2016 21:02:55 +0000 (21:02 +0000)]
Use bogus_page to properly reduce number of I/Os in sendfile(2).  The new
sendfile_swapin() loop works this way:

- Find first invalid page in the request.
- Do vm_pager_has_page() and get count of pages, that can be taken in
  single I/O.
- Trim valid pages from the end of the request.
- Cycle through the request and substitute to bogus_page all valid
  pages that are in the middle of the request.
- After I/O launched (pager copies array of pages into buf(9), it
  is important to restore proper page pointers with help vm_page_lookup().

Count bogus pages used and report them in sendfile stats.

7 years agoAfter some ZIL changes 6 years ago zil_slog_limit got partially broken
Alexander Motin [Thu, 17 Nov 2016 21:01:27 +0000 (21:01 +0000)]
After some ZIL changes 6 years ago zil_slog_limit got partially broken
due to zl_itx_list_sz not updated when async itx'es upgraded to sync.
Actually because of other changes about that time zl_itx_list_sz is not
really required to implement the functionality, so this patch removes
some unneeded broken code and variables.

Original idea of zil_slog_limit was to reduce chance of SLOG abuse by
single heavy logger, that increased latency for other (more latency critical)
loggers, by pushing heavy log out into the main pool instead of SLOG. Beside
huge latency increase for heavy writers, this implementation caused double
write of all data, since the log records were explicitly prepared for SLOG.
Since we now have I/O scheduler, I've found it can be much more efficient
to reduce priority of heavy logger SLOG writes from ZIO_PRIORITY_SYNC_WRITE
to ZIO_PRIORITY_ASYNC_WRITE, while still leave them on SLOG.

Existing ZIL implementation had problem with space efficiency when it
has to write large chunks of data into log blocks of limited size. In some
cases efficiency stopped to almost as low as 50%. In case of ZIL stored on
spinning rust, that also reduced log write speed in half, since head had to
uselessly fly over allocated but not written areas. This change improves
the situation by offloading problematic operations from z*_log_write() to
zil_lwb_commit(), which knows real situation of log blocks allocation and
can split large requests into pieces much more efficiently. Also as side
effect it removes one of two data copy operations done by ZIL code WR_COPIED
case.

While there, untangle and unify code of z*_log_write() functions.
Also zfs_log_write() alike to zvol_log_write() can now handle writes crossing
block boundary, that may also improve efficiency if ZPL is made to do that.

Sponsored by: iXsystems, Inc.

7 years agoRevert r307392: I've found a way to avoid big allocations completely.
Alexander Motin [Thu, 17 Nov 2016 20:44:51 +0000 (20:44 +0000)]
Revert r307392:  I've found a way to avoid big allocations completely.

7 years agoFix "camcontrol rescan" with SATA drives behind a SAS controller
Alan Somers [Thu, 17 Nov 2016 20:42:56 +0000 (20:42 +0000)]
Fix "camcontrol rescan" with SATA drives behind a SAS controller

A bug in CAM's serial number hash logic resulted in SATA drives behind a SAS
controller getting removed and readded anytime the drive was rescanned for
any reason.

PR: 212914
Submitted by: kadesai
Reported by: kadesai
Reviewed by: asomers, ken
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

7 years agoPass SWAPSIZE in env(1) when invoking mk-vmimage.sh for the
Glen Barber [Thu, 17 Nov 2016 20:34:08 +0000 (20:34 +0000)]
Pass SWAPSIZE in env(1) when invoking mk-vmimage.sh for the
vm-image target, missed in r308737.

Sponsored by: The FreeBSD Foundation

7 years ago- If caller specifies readbehind and readahead that together with count
Gleb Smirnoff [Thu, 17 Nov 2016 20:32:32 +0000 (20:32 +0000)]
- If caller specifies readbehind and readahead that together with count
  doesn't fit into a buf, then trim readbehind and readahead evenly.  If
  rbehind was limited by the previous BMAP, then roundup its trim to
  block size.
- Add KASSERT to check that b_blkno has proper offset from original
  blkno returned by BMAP. [1]
- Add KASSERT to check that pages in buf are consecutive.

Reviewed by: kib
Submitted by: kib [1]

7 years ago[iwm] Sync iwm_nvm_read_chunk() function with Linux iwlwifi.
Imre Vadász [Thu, 17 Nov 2016 20:00:20 +0000 (20:00 +0000)]
[iwm] Sync iwm_nvm_read_chunk() function with Linux iwlwifi.

This fixes an error handling detail in iwm_nvm_read_chunk(), where an
error response from the firmware for an NVM read shouldn't be fatal if
the offset was non-zero.

Approved by: adrian (mentor)
Obtained from: DragonFlyBSD git 250a1c33fca1725121fe499f9cebc90267d209f9
Differential Revision: https://reviews.freebsd.org/D8542

7 years agoloader: zfs toplevel vdev must have spa set.
Toomas Soome [Thu, 17 Nov 2016 19:38:30 +0000 (19:38 +0000)]
loader: zfs toplevel vdev must have spa set.

The salt based checksum mechanisms, such as skein, are storing the seed
in spa structure, and need to access the spa to use the seed. The current
mechanism for quick access to correct spa is via pointer provided by
vdev structure, but unfortunately the current code does set spa only
for the leaf vdev. This patch will fix the issue by making sure the
loader zfs reader will set spa also for top-level vdevs.

PR: 214375
Reported by: lstewart
Reviewed by: allanjude, imp
Approved by: allanjude (mentor), imp (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8487

7 years agoZero etherswitch_vlangroup structure before doing partial assignments.
Luiz Otavio O Souza [Thu, 17 Nov 2016 19:02:25 +0000 (19:02 +0000)]
Zero etherswitch_vlangroup structure before doing partial assignments.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoloader: beri_sdcard_disk_print() needs to return int.
Toomas Soome [Thu, 17 Nov 2016 18:38:35 +0000 (18:38 +0000)]
loader: beri_sdcard_disk_print() needs to return int.

The https://reviews.freebsd.org/rS308434 did change the return type for
dv_print callbacks, but the return type for beri_sdcard_disk_print()
was left unchanged, causing compile errors.

Reported by: cy
Reviewed by: brooks, rstone, allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D8515

7 years agoDefine dependencies for some auto-generated source files in libdtrace.
Mark Johnston [Thu, 17 Nov 2016 18:13:42 +0000 (18:13 +0000)]
Define dependencies for some auto-generated source files in libdtrace.

Remove an unneeded beforedepend rule.

Reported by: emaste, jhb
Reviewed by: bdrewery
MFC after: 1 week

7 years agocrunchide: report explicit error for combined string table
Ed Maste [Thu, 17 Nov 2016 18:12:17 +0000 (18:12 +0000)]
crunchide: report explicit error for combined string table

Some tools produce objects with a combined strtab and shstrtab.
These objects are not supported by crunchide since it rewrites the
symtab and strtab to "hide" symbols. This invalidates section header
offsets into a combined strtab/shstrtab.

In the future we could support these objects (by ensuring that we retain
unmodified section name strings in the output .strtab, and then rewriting
each section header's sh_name).

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agoFix build when no INET and INET6 in kernel config.
Ruslan Bukin [Thu, 17 Nov 2016 16:13:30 +0000 (16:13 +0000)]
Fix build when no INET and INET6 in kernel config.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoDo not reallocate driver softc for uart unnecessarily.
Ruslan Bukin [Thu, 17 Nov 2016 16:06:53 +0000 (16:06 +0000)]
Do not reallocate driver softc for uart unnecessarily.

Do not assume that all uart drivers use uart_softc structure as is.
Some do a sensible thing and do declare their uart class and driver
properly and arrive into uart_bus_attach with suitably sized softc.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoMake gpiobus early driver at BUS_PAS_BUS.
Ruslan Bukin [Thu, 17 Nov 2016 15:37:44 +0000 (15:37 +0000)]
Make gpiobus early driver at BUS_PAS_BUS.

The gpiobus driver is attached explicitly and generally should be
at the same pass as its parent. Making it use BUS_PAS_BUS ensures
that it attaches immediately after parent adds it (assuming the
parent itself attached at BUS_PAS_BUS and above).

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoMore robust handling of whois referrals from RIRs.
Tony Finch [Thu, 17 Nov 2016 15:19:06 +0000 (15:19 +0000)]
More robust handling of whois referrals from RIRs.

An example problem case is 163.1.0.0 (University of Oxford)
which is in an APNIC ERX address range. Previously we assumed
that ARIN has the correct information for all ERX allocations,
but in this case ARIN refers back to APNIC, rather than referring
to RIPE. This caused whois to loop.

Whois will no longer loop back and forth forever between two RIRs
that don't have an answer, but instead try the other RIRs in turn.

7 years agoDeclare dwc_otg_detach as non-static (same as dwc_otg_attach),
Ruslan Bukin [Thu, 17 Nov 2016 15:12:03 +0000 (15:12 +0000)]
Declare dwc_otg_detach as non-static (same as dwc_otg_attach),
so it can be called from fdt-glue drivers.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoAllow operation with UTMI+ phy.
Ruslan Bukin [Thu, 17 Nov 2016 15:08:30 +0000 (15:08 +0000)]
Allow operation with UTMI+ phy.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoRemove outdated comment.
Ruslan Bukin [Thu, 17 Nov 2016 14:43:13 +0000 (14:43 +0000)]
Remove outdated comment.

Pointed out by: andrew (original author)
Sponsored by: DARPA, AFRL

7 years agoAdd support for UART found in the Ingenic XBurst system on chips.
Ruslan Bukin [Thu, 17 Nov 2016 14:41:22 +0000 (14:41 +0000)]
Add support for UART found in the Ingenic XBurst system on chips.

These CPUs has non-standard UART enable bit hidden in the UART FIFO
Control Register.

Sponsored by: DARPA, AFRL

7 years agoWriting out the L2TP control packet requires 12 bytes of
Bjoern A. Zeeb [Thu, 17 Nov 2016 14:03:44 +0000 (14:03 +0000)]
Writing out the L2TP control packet requires 12 bytes of
contiguous memory but in one path we did not always guarantee this,
thus do a m_pullup() there.

PR: 214385
Submitted by: Joe Jones (joeknockando googlemail.com)
MFC after: 3 days

7 years agoAdd driver for DM9000 Ethernet MAC Controller.
Ruslan Bukin [Thu, 17 Nov 2016 11:48:07 +0000 (11:48 +0000)]
Add driver for DM9000 Ethernet MAC Controller.

This device found in the Ingenic jz4780 SoC.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoImport Ingenic CI20 (jz4780) DTS files.
Ruslan Bukin [Thu, 17 Nov 2016 11:31:13 +0000 (11:31 +0000)]
Import Ingenic CI20 (jz4780) DTS files.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoNotify the use via setting errno when a TCP RST segment is received
Michael Tuexen [Thu, 17 Nov 2016 08:15:02 +0000 (08:15 +0000)]
Notify the use via setting errno when a TCP RST segment is received
either in the CLOSING or LAST-ACK state.

Reviewed by: hiren
MFC after: 3 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D8371

7 years ago[etherswitch] add infineon adm6996fc support on etherswitch
Michael Zhilin [Thu, 17 Nov 2016 07:33:37 +0000 (07:33 +0000)]
[etherswitch] add infineon adm6996fc support on etherswitch

This is Infineon ADM6996FC/M/MX driver code on etherswitch framework.
Support PORT and DOT1Q VLAN.
This code suppose ADM6996FC SDC/SDIO connect to SOC network interface
MDC/MDIO.
This code tested on Netgear WGR614Cv7.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: adrian, mizhka
Approved by: adrian(mentor)
Differential Revision: https://reviews.freebsd.org/D8495

7 years agohyperv/vss: Install the userland daemon to /usr/sbin instead of /
Sepherosa Ziehau [Thu, 17 Nov 2016 03:02:35 +0000 (03:02 +0000)]
hyperv/vss: Install the userland daemon to /usr/sbin instead of /

Submitted by: markj
Reported by: markj
MFC after: 3 weeks
Sponsored by: Microsoft

7 years agohyperv/vss: Nuke unused variables.
Sepherosa Ziehau [Thu, 17 Nov 2016 03:00:56 +0000 (03:00 +0000)]
hyperv/vss: Nuke unused variables.

Submitted by: markj
Reported by: markj
MFC after: 3 weeks
Sponsored by: Microsoft

7 years agoFix grammar nit
Bryan Drewery [Thu, 17 Nov 2016 00:21:55 +0000 (00:21 +0000)]
Fix grammar nit

7 years agoPass SWAPSIZE in env(1) when invoking mk-vmimage.sh, otherwise
Glen Barber [Wed, 16 Nov 2016 18:08:50 +0000 (18:08 +0000)]
Pass SWAPSIZE in env(1) when invoking mk-vmimage.sh, otherwise
mkimg(1) does not create the second partition after r307008.

Sponsored by: The FreeBSD Foundation

7 years agoAllow installworld to be skipped as well as installkernel with -W.
Warner Losh [Wed, 16 Nov 2016 17:11:05 +0000 (17:11 +0000)]
Allow installworld to be skipped as well as installkernel with -W.
Allow -B to mean -K -W.

There are times when fixing non-base elementes of the build that you
don't want to wait to get a completely clean world install. This
allows that at the cost of a little danger.

Submitted by: gallatin@
Sponsored by: Netflix, Inc

7 years agoStart to move the old interface into a legacy file.
Warner Losh [Wed, 16 Nov 2016 16:49:21 +0000 (16:49 +0000)]
Start to move the old interface into a legacy file.

7 years agocrunchide: remove obsolete a.out header and comment
Ed Maste [Wed, 16 Nov 2016 16:39:51 +0000 (16:39 +0000)]
crunchide: remove obsolete a.out header and comment

crunchide(1) gained ELF support in r39172, and lost the unused a.out
and non-functional ECOFF suport in r281655.

Sponsored by: The FreeBSD Foundation

7 years agoMove the fast fault path into the separate function.
Konstantin Belousov [Wed, 16 Nov 2016 16:34:17 +0000 (16:34 +0000)]
Move the fast fault path into the separate function.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd full softfloat and hardfloat support for RISC-V.
Ruslan Bukin [Wed, 16 Nov 2016 15:21:32 +0000 (15:21 +0000)]
Add full softfloat and hardfloat support for RISC-V.

Hardfloat is now default (use riscv64sf as TARGET_ARCH
for softfloat).

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8529

7 years agoMake sure MAC address is reprogrammed when if_init() callback is
Hans Petter Selasky [Wed, 16 Nov 2016 14:39:03 +0000 (14:39 +0000)]
Make sure MAC address is reprogrammed when if_init() callback is
invoked. Else promiscious mode must be used to pass traffic. While at
it fix a debug print macro.

MFC after: 1 week

7 years agoAdd bnxt(4) to the hardware notes.
Christian Brueffer [Wed, 16 Nov 2016 13:27:39 +0000 (13:27 +0000)]
Add bnxt(4) to the hardware notes.

7 years agoVarious minor cleanups.
Christian Brueffer [Wed, 16 Nov 2016 13:22:57 +0000 (13:22 +0000)]
Various minor cleanups.

7 years agoInclude the SMSC LAN91C111 driver, this is found in some of the ARM models.
Andrew Turner [Wed, 16 Nov 2016 11:37:43 +0000 (11:37 +0000)]
Include the SMSC LAN91C111 driver, this is found in some of the ARM models.

7 years agoUse the correct OF_getencprop to get the height.
Andrew Turner [Wed, 16 Nov 2016 11:31:53 +0000 (11:31 +0000)]
Use the correct OF_getencprop to get the height.

Reported by: jmcneill
Sponsored by: ABT Systems Ltd

7 years agohyperv/pcib: enable PCIe pass-through (a.k.a. Discrete Device Assignment)
Dexuan Cui [Wed, 16 Nov 2016 09:25:00 +0000 (09:25 +0000)]
hyperv/pcib: enable PCIe pass-through (a.k.a. Discrete Device Assignment)

The feature enables us to pass through physical PCIe devices to FreeBSD VM
running on Hyper-V (Windows Server 2016) to get near-native performance with
low CPU utilization.

The patch implements a PCI bridge driver to support the feature:

1) The pcib driver talks to the host to discover device(s) and presents
the device(s) to FreeBSD's pci driver via PCI configuration space (note:
to access the configuration space, we don't use the standard I/O port
0xCF8/CFC method; instead, we use an MMIO-based method supplied by Hyper-V,
which is very similar to the 0xCF8/CFC method).

2) The pcib driver allocates resources for the device(s) and initialize
the related BARs, when the device driver's attach method is invoked;

3) The pcib driver talks to the host to create MSI/MSI-X interrupt
remapping between the guest and the host;

4) The pcib driver supports device hot add/remove.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8332

7 years agohyperv/vmbus: add new vmbus methods to support PCIe pass-through
Dexuan Cui [Wed, 16 Nov 2016 09:08:32 +0000 (09:08 +0000)]
hyperv/vmbus: add new vmbus methods to support PCIe pass-through

The new methods will be used by the coming pcib driver.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8409

7 years agohyperv/vmbus: add a new method to get vcpu_id
Dexuan Cui [Wed, 16 Nov 2016 09:02:17 +0000 (09:02 +0000)]
hyperv/vmbus: add a new method to get vcpu_id

vcpu_id is host's representation of guest CPU.
We get the mapping between vcpu_id and FreeBSD kernel's cpu id when VMBus
driver is loaded. Later, when a driver, like the coming pcib driver, talks
to the host and needs to refer to a guest CPU, the driver must use the
vcpu_id.

Reviewed by: jhb, sephe
Approved by: sephe (mentor)
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8410

7 years agoSimplify the page tracking for VA<->PA translations.
Justin Hibbits [Wed, 16 Nov 2016 05:24:42 +0000 (05:24 +0000)]
Simplify the page tracking for VA<->PA translations.

Drop the tracking down to the pmap layer, with optimizations to only track
necessary pages.  This should give a (slight) performance improvement, as well
as a stability improvement, as the tracking is already mostly handled by the
pmap layer.

7 years agoCompile trampoline with soft-float on MIPS, to match the rest of the kernel
Alexander Kabaev [Wed, 16 Nov 2016 03:24:20 +0000 (03:24 +0000)]
Compile trampoline with soft-float on MIPS, to match the rest of the kernel

Core kernel is always compiled with -msoft-float on all of our platforms,
make sure we follow the suit with trampoline as well.

Reviewed by: adrian, br, imp
Differential Revision: https://reviews.freebsd.org/D8507

7 years agoMake MIPS startup assembly files use neutral float ABI.
Alexander Kabaev [Wed, 16 Nov 2016 03:21:49 +0000 (03:21 +0000)]
Make MIPS startup assembly files use neutral float ABI.

This allows these files to be used with hard and softfloat targets
with no special flags passed to the compiler.

Reviewed by: adrian, br, imp
Differential Revision: https://reviews.freebsd.org/D8506

7 years agoSet endianness and floating point flags explicitly for MIPS targets
Alexander Kabaev [Wed, 16 Nov 2016 03:19:36 +0000 (03:19 +0000)]
Set endianness and floating point flags explicitly for MIPS targets

The tree can be build with an external toolchain that will not
necessarily default to desired settings, so we have to specify
the required flags explicitly to force the required compilation
mode.

Reviewed by: adrian, br
Sponsored by: https://reviews.freebsd.org/D8505

7 years agoUpdate to reflect the demise of PG_CACHED pages.
Alan Cox [Wed, 16 Nov 2016 02:51:24 +0000 (02:51 +0000)]
Update to reflect the demise of PG_CACHED pages.

Reviewed by: kib, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8530

7 years agoAdd a GPIO poweroff and reset driver.
Justin Hibbits [Wed, 16 Nov 2016 02:14:07 +0000 (02:14 +0000)]
Add a GPIO poweroff and reset driver.

Summary:
This implements part of the gpio-poweroff and gpio-restart device tree
bindings.  Optional properties are not handled currently.  It also currently
only supports level-triggered reset.

Reviewed By: gonzo
Differential Revision: https://reviews.freebsd.org/D8521

7 years agoReduce NFS "NFSv4( mounted on)? fileid > 32bits" log spam.
Colin Percival [Wed, 16 Nov 2016 01:11:49 +0000 (01:11 +0000)]
Reduce NFS "NFSv4( mounted on)? fileid > 32bits" log spam.

Rather than printing a warning for every time we receive a fileid > 2^32
from the NFS server, count warnings and print at most one of each warning
type per minute, e.g.,

Nov 15 05:17:34 ip-172-30-1-221 kernel: NFSv4 fileid > 32bits (24730 occurrences)
Nov 15 05:17:56 ip-172-30-1-221 kernel: NFSv4 mounted on fileid > 32bits (178 occurrences)
Nov 15 05:18:53 ip-172-30-1-221 kernel: NFSv4 fileid > 32bits (7582 occurrences)
Nov 15 05:18:58 ip-172-30-1-221 kernel: NFSv4 mounted on fileid > 32bits (23 occurrences)

A buildworld with an NFS mounted /usr/obj can otherwise result in
hundreds of thousands of lines being printed, which seems unnecessarily
verbose.

When ino_t becomes a 64-bit type, these printfs will no longer be needed
(and the problems associated with truncating 64-bit fileids to generate
32-bit inode numbers will also go away).

Reviewed by: rmacklem
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D8523

7 years agoRemove a lingering reference to cache pages from vmstat(8).
Mark Johnston [Wed, 16 Nov 2016 00:21:18 +0000 (00:21 +0000)]
Remove a lingering reference to cache pages from vmstat(8).

Reported by: alc

7 years agoOn command error, reset only DMA and FIFO engines instead of the entire
Jared McNeill [Tue, 15 Nov 2016 23:48:30 +0000 (23:48 +0000)]
On command error, reset only DMA and FIFO engines instead of the entire
controller. Fixes eMMC device detection on OrangePi Plus 2e (and likely
others).

7 years agoAllow the MMC frequency to be set up to 52MHz for MMC high speed timings.
Jared McNeill [Tue, 15 Nov 2016 23:46:01 +0000 (23:46 +0000)]
Allow the MMC frequency to be set up to 52MHz for MMC high speed timings.

7 years ago[etherswitch] enable phy4/mac4 of ip175c
Michael Zhilin [Tue, 15 Nov 2016 22:30:25 +0000 (22:30 +0000)]
[etherswitch] enable phy4/mac4 of ip175c

If MII1 interface is disabled, then enable phy4/mac4.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka, adrian
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D6832

7 years ago[etherswitch] add RTL8366SR support
Michael Zhilin [Tue, 15 Nov 2016 21:58:04 +0000 (21:58 +0000)]
[etherswitch] add RTL8366SR support

Add RTL8366SR support at etherswitch driver. Tested on RTL8366RB and
RTL8366SR.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: adrian, mizhka
Approved by: adrian(mentor)
Differential Revision: https://reviews.freebsd.org/D6796

7 years ago[etherswitch] add Marvell 88e6060 switch support
Michael Zhilin [Tue, 15 Nov 2016 21:49:01 +0000 (21:49 +0000)]
[etherswitch] add Marvell 88e6060 switch support

Add 88e6060 basic support: only port-based VLAN is supported.
No vlan(4) support.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka, adrian
Approved by: adrian(mentor)
Differential Revision: https://reviews.freebsd.org/D8344

7 years agoAfter r308533, the platform compatible string must be an exact match.
Luiz Otavio O Souza [Tue, 15 Nov 2016 21:18:55 +0000 (21:18 +0000)]
After r308533, the platform compatible string must be an exact match.

Use "ti,am33xx" instead of "ti,am335x", which gives an exact match in every
DTS we support.

This fixes the boot on TI SoCs after r308533.

Suggested by: gonzo
Sponsored by: Rubicon Communications, LLC (Netgate)