]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoRemove the si(4) driver and sicontrol(8) for Specialix serial cards.
jhb [Fri, 19 Aug 2016 21:14:27 +0000 (21:14 +0000)]
Remove the si(4) driver and sicontrol(8) for Specialix serial cards.

The si(4) driver supported multiport serial adapters for ISA, EISA, and
PCI buses.  This driver does not use bus_space, instead it depends on
direct use of the pointer returned by rman_get_virtual().  It is also
still locked by Giant and calls for patch testing to convert it to use
bus_space were unanswered.

Relnotes: yes

7 years agoRemove doxygen files for mcd(4) and scd(4) drivers.
jhb [Fri, 19 Aug 2016 20:53:55 +0000 (20:53 +0000)]
Remove doxygen files for mcd(4) and scd(4) drivers.

Submitted by: ak

7 years agoRemove the scd(4) driver for Sony CDU31/33 CD-ROM drives.
jhb [Fri, 19 Aug 2016 19:31:55 +0000 (19:31 +0000)]
Remove the scd(4) driver for Sony CDU31/33 CD-ROM drives.

This is a driver for a pre-ATAPI ISA CD-ROM adapter.  The driver only
uses PIO.

7 years agoMove cxgb and cxgbe down to the non-mii PCI NIC section.
jhb [Fri, 19 Aug 2016 18:45:42 +0000 (18:45 +0000)]
Move cxgb and cxgbe down to the non-mii PCI NIC section.

7 years agoKeep boot parameters in ARM trampoline code
manu [Fri, 19 Aug 2016 18:02:36 +0000 (18:02 +0000)]
Keep boot parameters in ARM trampoline code

Currently boot parameters (r0 - r3) are forgotten in ARM trampoline code.
This patch save them at startup and restore them before jumping into kernel
_start() routine.
This is usefull when booting with Linux ABI and/or custom bootloader.

Submitted by: Grégory Soutadé <soutade@gmail.com>
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D7395

7 years agoDon't set P2_PTRACE_FSTP in a process that invokes ptrace(PT_TRACE_ME).
markj [Fri, 19 Aug 2016 17:57:14 +0000 (17:57 +0000)]
Don't set P2_PTRACE_FSTP in a process that invokes ptrace(PT_TRACE_ME).

Such processes are stopped synchronously by a direct call to
ptracestop(SIGTRAP) upon exec. P2_PTRACE_FSTP causes the exec()ing thread
to suspend itself while waiting for a SIGSTOP that never arrives.

Reviewed by: kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7576

7 years agoReorder sysctls so that nodes shared with the VF driver are added first.
jhb [Fri, 19 Aug 2016 17:54:51 +0000 (17:54 +0000)]
Reorder sysctls so that nodes shared with the VF driver are added first.

This permits a single early return for VF devices in the routines that
add sysctl nodes.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7512

7 years agoRegenerate system call table after r304483.
ed [Fri, 19 Aug 2016 17:54:06 +0000 (17:54 +0000)]
Regenerate system call table after r304483.

7 years agoUse the proper value for svn:keywords.
ed [Fri, 19 Aug 2016 17:53:37 +0000 (17:53 +0000)]
Use the proper value for svn:keywords.

Pointy hat to: me

7 years agoAdjust t4_port_init() to work with VF devices.
jhb [Fri, 19 Aug 2016 17:52:48 +0000 (17:52 +0000)]
Adjust t4_port_init() to work with VF devices.

Specifically, the FW_PORT_CMD may or may not work for a VF (the PF
driver can choose whether or not to permit access to this command),
so don't attempt to fetch port information on a VF if permission is
denied by the PF.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7511

7 years agoAdd missing SVN keywords keyword.
ed [Fri, 19 Aug 2016 17:51:52 +0000 (17:51 +0000)]
Add missing SVN keywords keyword.

7 years agoAdd structures for VF-specific adapter parameters.
jhb [Fri, 19 Aug 2016 17:49:49 +0000 (17:49 +0000)]
Add structures for VF-specific adapter parameters.

While here, mark which parameters are PF-specific and which are
VF-specific.

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7508

7 years agoImport the new automatically generated system call table for CloudABI.
ed [Fri, 19 Aug 2016 17:49:35 +0000 (17:49 +0000)]
Import the new automatically generated system call table for CloudABI.

Now that we've switched over to using the vDSO on CloudABI, it becomes a
lot easier for us to phase out old features. System call numbering is no
longer something that's part of the ABI. It's fully based on names. As
long as the numbering used by the kernel and the vDSO is consistent
(which it always is), it's all right.

Let's put this to the test by removing a system call (thread_tcb_set())
that's already unused for quite some time now, but was only left intact
to serve as a placeholder. Sync in the new system call table that uses
alphabetic sorting of system calls.

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

7 years agoFix various nits in the aio operation manpages.
jhb [Fri, 19 Aug 2016 17:37:32 +0000 (17:37 +0000)]
Fix various nits in the aio operation manpages.

- Avoid double use of "request" in a single sentence.  Instead, describe
  aio_sigevent as being used to request notification of the associated
  operation's completion.  This matches the language used to describe
  aio_sigevent in aio(4).
- Simplify the prohibition on modifying buffers while requests are in
  flight.
- Fix case mismatch.
- Drop note about not using stack variables. C programmers should be able
  to figure out if a stack variable is safe based on the later warning
  about the life cycle requirements of control blocks.
- Remove prohibition on modifying the I/O buffer for aio_fsync() since
  it does not use an I/O buffer.  For aio_mlock(), prohibit modifications
  to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not
  prohibit modifications to the memory backing the buffer (stores into
  the pages backing the buffer).

Requested by: wblock (1,2), kib (4)
Reviewed by: kib, rpokala, wblock
MFC after: 3 days
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7462

7 years agoAllwinner: Move a10_padconf.c into a10 subdirectory.
manu [Fri, 19 Aug 2016 12:48:32 +0000 (12:48 +0000)]
Allwinner: Move a10_padconf.c into a10 subdirectory.

7 years agoTEGRA: Remove forgotten debug printf.
mmel [Fri, 19 Aug 2016 11:12:59 +0000 (11:12 +0000)]
TEGRA: Remove forgotten debug printf.

7 years agoTEGRA: Implement MSI/MSIX interrupts for pcie controller.
mmel [Fri, 19 Aug 2016 10:53:17 +0000 (10:53 +0000)]
TEGRA: Implement MSI/MSIX interrupts for pcie controller.

7 years agoINTRNG: Rework handling with resources. Partially revert r301453.
mmel [Fri, 19 Aug 2016 10:52:39 +0000 (10:52 +0000)]
INTRNG: Rework handling with resources. Partially revert r301453.
 - Read interrupt properties at bus enumeration time and store
   it into global mapping table.
 - At bus_activate_resource() time, given mapping entry is resolved and
   connected to real interrupt source. A copy of mapping entry is attached
   to given resource.
 - At bus_setup_intr() time, mapping entry stored in resource is used
   for delivery of requested interrupt configuration.
 - For MSI/MSIX interrupts, mapping entry is created within
   pci_alloc_msi()/pci_alloc_msix() call.
 - For legacy PCI interrupts, mapping entry must be created within
   pcib_route_interrupt() by pcib driver itself.

Reviewed by: nwhitehorn, andrew
Differential Revision: https://reviews.freebsd.org/D7493

7 years agoHost controller is byte oriented. Fix wrong assumption on big-endian
yongari [Fri, 19 Aug 2016 10:51:30 +0000 (10:51 +0000)]
Host controller is byte oriented.  Fix wrong assumption on big-endian
systems.

Pointed out by: hselasky

7 years agohyperv/hn: Move RXBUF to hn_softc
sephe [Fri, 19 Aug 2016 05:43:28 +0000 (05:43 +0000)]
hyperv/hn: Move RXBUF to hn_softc

And don't recreate RXBUF for each primary channel open, it is now
created in device_attach DEVMETHOD and destroyed in device_detach
DEVMETHOD.

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

7 years agohyperv/hn: Remove the useless num_channel
sephe [Fri, 19 Aug 2016 05:30:39 +0000 (05:30 +0000)]
hyperv/hn: Remove the useless num_channel

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

7 years agohyperv/hn: Remove assign-only struct field
sephe [Fri, 19 Aug 2016 05:20:12 +0000 (05:20 +0000)]
hyperv/hn: Remove assign-only struct field

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

7 years agoImprove the pattern matching so that internal *'s work, as well as
imp [Fri, 19 Aug 2016 04:30:29 +0000 (04:30 +0000)]
Improve the pattern matching so that internal *'s work, as well as
[set] notation. This fixes pattern matching for recently added drives
that would set the NCQ Trim being broken incorrectly.

PR: 210686
Tested-by: Tomoaki AOKI
MFC After: 3 days

7 years agohyperv/hn: Move NVS version to softc
sephe [Fri, 19 Aug 2016 03:32:04 +0000 (03:32 +0000)]
hyperv/hn: Move NVS version to softc

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

7 years agoCorrect a check for P2_PTRACE_FSTP in ptracestop().
markj [Fri, 19 Aug 2016 01:27:24 +0000 (01:27 +0000)]
Correct a check for P2_PTRACE_FSTP in ptracestop().

MFC after: 1 day

7 years agoFix build on big-endian systems.
yongari [Fri, 19 Aug 2016 00:50:32 +0000 (00:50 +0000)]
Fix build on big-endian systems.

Reported by: bz

7 years agoFsck_ufs was using an int rather than a ufs2_daddr_t to store the
mckusick [Fri, 19 Aug 2016 00:03:41 +0000 (00:03 +0000)]
Fsck_ufs was using an int rather than a ufs2_daddr_t to store the
alternate superblock location when given in the -b option. When int
is 32-bits, block numbers larger than 2^32 would get truncated. This
commit changes the storage fpr the alternate superblock location
to a ufs2_daddr_t.

Submitted by: Dmitry Sivachenko <trtrmitya@gmail.com>

7 years agoFix unlocked access to ifnet address list
rstone [Thu, 18 Aug 2016 22:59:10 +0000 (22:59 +0000)]
Fix unlocked access to ifnet address list

in_broadcast() was iterating over the ifnet address list without
first taking an IF_ADDR_RLOCK.  This could cause a panic if a
concurrent operation modified the list.

Reviewed by: bz
MFC after: 2 months
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7227

7 years agoDon't check for broadcast IPs on non-bcast pkts
rstone [Thu, 18 Aug 2016 22:59:05 +0000 (22:59 +0000)]
Don't check for broadcast IPs on non-bcast pkts

in_broadcast() can be quite expensive, so skip calling it if the
incoming mbuf wasn't sent to a broadcast L2 address in the first
place.

Reviewed by: gnn
MFC after: 2 months
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7309

7 years agoDon't iterate over the ifnet addr list in ip_output()
rstone [Thu, 18 Aug 2016 22:59:00 +0000 (22:59 +0000)]
Don't iterate over the ifnet addr list in ip_output()

For almost every packet that is transmitted through ip_output(),
a call to in_broadcast() was made to decide if the destination
IP was a broadcast address.  in_broadcast() iterates over the
ifnet's address to find a source IP matching the subnet of the
destination IP, and then checks if the IP is a broadcast in that
subnet.

This is completely redundant as we have already performed the
route lookup, so the source IP is already known.  Just use that
address to directly check whether the destination IP is a
broadcast address or not.

MFC after: 2 months
Sponsored By: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7266

7 years agoAdd a SIGINFO handler for dtrace(1).
markj [Thu, 18 Aug 2016 17:27:58 +0000 (17:27 +0000)]
Add a SIGINFO handler for dtrace(1).

Have it print the contents of aggregations, if any. Otherwise, one needs to
kill the running script to view the collected data, or add code to
periodically print it.

Discussed with: gnn
MFC after: 1 month

7 years agovt: fix old keyboard release in CONS_SETKBD
emaste [Thu, 18 Aug 2016 16:22:40 +0000 (16:22 +0000)]
vt: fix old keyboard release in CONS_SETKBD

On the first switch we previously released the newly allocated keyboard
instead of the old one. Keyboard state was very confused afterwards for
further keyboard switches.

Submitted by: bde

7 years agoRemove the obsolete and unused openbsd_poll system call. (Phase 2)
gnn [Thu, 18 Aug 2016 10:54:39 +0000 (10:54 +0000)]
Remove the obsolete and unused openbsd_poll system call. (Phase 2)

Reported by: brooks
Reviewed by: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D7548

7 years agoRemove unusedd and obsolete openbsd_poll system call. (Phase 1)
gnn [Thu, 18 Aug 2016 10:50:40 +0000 (10:50 +0000)]
Remove unusedd and obsolete openbsd_poll system call.  (Phase 1)

Reported by: brooks
Reviewed by: brooks,jhb
Differential Revision: https://reviews.freebsd.org/D7548

7 years agoTry to fix gcc compilation errors (which are right).
bz [Thu, 18 Aug 2016 10:26:15 +0000 (10:26 +0000)]
Try to fix gcc compilation errors (which are right).
nat64_getlasthdr() returns an int, which can be -1 in case of error,
storing the result in an uint8_t and then comparing to < 0 is not
helpful.  Do what is done in the rest of the code and make proto an
int here as well.

7 years agoFix TAB replaced with spaces in prev. commit.
ache [Thu, 18 Aug 2016 10:18:11 +0000 (10:18 +0000)]
Fix TAB replaced with spaces in prev. commit.

7 years agoAdd support for setting blocking and non-blocking mode on /dev/rdma_cm
hselasky [Thu, 18 Aug 2016 08:49:02 +0000 (08:49 +0000)]
Add support for setting blocking and non-blocking mode on /dev/rdma_cm
by returning success on FIONBIO and FIOASYNC IOCTLs. The actual flags
handling is done by the kern_ioctl() function.

Reported by: Alex Bowden <alex.bowden@outlook.com>
Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agoWhen device is detached make sure to stop the controller and make
yongari [Thu, 18 Aug 2016 07:11:31 +0000 (07:11 +0000)]
When device is detached make sure to stop the controller and make
it return zero-length USB packet.

7 years agoIn axge_stop(), clear medium receive enable bit which will stop RX
yongari [Thu, 18 Aug 2016 06:46:14 +0000 (06:46 +0000)]
In axge_stop(), clear medium receive enable bit which will stop RX
MAC operation.

7 years agoRemove <sys/types.h> from the SYNOPSIS.
kevlo [Thu, 18 Aug 2016 06:39:09 +0000 (06:39 +0000)]
Remove <sys/types.h> from the SYNOPSIS.

7 years agoWhen usbd_transfer_setup() fails, don't call
yongari [Thu, 18 Aug 2016 06:35:09 +0000 (06:35 +0000)]
When usbd_transfer_setup() fails, don't call
usbd_transfer_unsetup().

7 years agoIntroduce axge_rxfilter() which configures RX filtering and replace
yongari [Thu, 18 Aug 2016 06:29:07 +0000 (06:29 +0000)]
Introduce axge_rxfilter() which configures RX filtering and replace
axge_setmulti()/axge_setpromisc() with axge_rxfilter().
Multicast filter programming and promiscuous mode requires
access to a common RX configuration register so there is no need to
use separate functions with added complexity.  axge_rxfilter() does
not read back AXGE_RCR register since accessing a register in USB
is too slow and we already have all knowledge of required
configuration.  Rebuilding RX filter configuration is simpler and
faster than manipulating every bits after reading back the
register.

Note, axge_rxfilter() does not set RCR_IPE(IP header alignment on
32bit boundary) to disable extra padding bytes insertion.  The
extra padding wastes ethernet to USB host bandwidth as well as
complicating RX handling logic.  Current USB framework requires
copying RX frames to mbufs so there is no need to worry about
alignment.  Previously axge_rx_frame() performed wrong bound check
due to the extra padding and it was broken when RX checksum
offloading is disabled.  See added comment in axge_rx_frame () for
actual RX packet layout.

In axge_init(), disable WOL.  It's meaningless to enable WOL in
normal operation.

In axge_rxeof(), use properly sized mbuf rather than blindly
allocating a mbuf cluster.

Use RX H/W checksum offloading only when administrator requested RX
checksum offloading. Previously it always used RX H/W checksum
offloading result regardless of RX checksum offloading state.

Separate L4 checksum offloading validation from L3 one and properly
set required offloading bits for each layer. This is to fix setting
L4 checksum offloading bits for L3 packets.

There are still lots of RX errors(probably RX FIFO overflows) under
moderate load.  Users are strongly recommended to enable ethernet
flow control.

Reviewed by: kevlo (initial version), hselasky

7 years agohyperv/kvp: Remove unnecessary function parameter.
sephe [Thu, 18 Aug 2016 06:03:55 +0000 (06:03 +0000)]
hyperv/kvp: Remove unnecessary function parameter.

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

7 years agohyperv/hn: Get rid of the useless netvsc_packet
sephe [Thu, 18 Aug 2016 05:52:03 +0000 (05:52 +0000)]
hyperv/hn: Get rid of the useless netvsc_packet

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

7 years agohyperv/hn: Constify RNDIS messages on RX path.
sephe [Thu, 18 Aug 2016 05:44:58 +0000 (05:44 +0000)]
hyperv/hn: Constify RNDIS messages on RX path.

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

7 years agohyperv/hn: Pass RX packet info to netvsc_recv.
sephe [Thu, 18 Aug 2016 05:33:58 +0000 (05:33 +0000)]
hyperv/hn: Pass RX packet info to netvsc_recv.

This paves to nuke netvsc_packet, which does not serves much
purpose now.

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

7 years agoSwitch to TX header format rather than directly manipulating header
yongari [Thu, 18 Aug 2016 05:07:02 +0000 (05:07 +0000)]
Switch to TX header format rather than directly manipulating header
structures.  This simplifies mbuf copy operation to USB buffers as
well as improving readability.  The controller supports Microsoft
LSOv1(aka TSO) but this change set does not include the support due
to copying overhead to USB buffers and large amount of memory waste.

Remove useless ZLP padding which seems to come from Linux.  Required
bits the code tried to set was not copied into USB buffer so it had
no effect.  Unlike Linux, FreeBSD USB stack automatically generates
ZLP so no explicit padding is required in driver.[1]

Micro-optimize updating IFCOUNTER_OPACKETS counter by moving it out
of TX loop since updating counter is not cheap operation as it did
long time ago and we already know how many number of packets were
queued after exiting the loop.

While here, fix a checksum offloading bug which will happen when
upper stack computes checksum while H/W checksum offloading is
active.  The controller should be notified to not recompute the
checksum in this case.

Reviewed by: kevlo (initial version), hselasky
Pointed out by: hselasky [1]

7 years agoRename cryptic RX filter constants with more readable ones.
yongari [Thu, 18 Aug 2016 04:25:17 +0000 (04:25 +0000)]
Rename cryptic RX filter constants with more readable ones.
No functional change.

7 years agoDon't explicitly call MIIBUS_STATCHG() method handler. Link state
yongari [Thu, 18 Aug 2016 02:14:39 +0000 (02:14 +0000)]
Don't explicitly call MIIBUS_STATCHG() method handler.  Link state
change should be handled by PHY driver.  Some broken PHY H/Ws may
need that workaround but it seems axge(4) don't use such PHYs.

7 years agoPass PHY location information and remove PHY access hack.
yongari [Thu, 18 Aug 2016 01:48:58 +0000 (01:48 +0000)]
Pass PHY location information and remove PHY access hack.

7 years ago[net80211] correctly lock the ifp before accessing the lladdr.
adrian [Thu, 18 Aug 2016 01:25:12 +0000 (01:25 +0000)]
[net80211] correctly lock the ifp before accessing the lladdr.

Tested by: dhw

7 years agoAdd SHA512, skein, large blocks support for loader zfs.
tsoome [Thu, 18 Aug 2016 00:37:07 +0000 (00:37 +0000)]
Add SHA512, skein, large blocks support for loader zfs.

Updated sha512 from illumos.
Using skein from freebsd crypto tree.
Since loader itself is using 64MB memory for heap, updated zfsboot to
use same, and this also allows to support zfs large blocks.

Note, adding additional features does increate zfsboot code, therefore
this update does increase zfsboot code to 128k, also I have ported gptldr.S
update to zfsldr.S to support 64k+ code.

With this update, boot1.efi has almost reached the current limit of the size
set for it, so one of the future patches for boot1.efi will need to
increase the limit.

Currently known missing zfs features in boot loader are edonr and gzip support.

Reviewed by: delphij, imp
Approved by: imp (mentor)
Obtained from: sha256.c update and skein_zfs.c stub from illumos.
Differential Revision: https://reviews.freebsd.org/D7418

7 years agoDisable assembly sources when compiler/assembler cannot compile certain
jkim [Wed, 17 Aug 2016 22:13:39 +0000 (22:13 +0000)]
Disable assembly sources when compiler/assembler cannot compile certain
instructions.  For example, GCC 4.2.1 + binutils 2.17.50 does not support
AVX instructions.

Reported by: bde
MFC after: 2 weeks

7 years agoPull in r262772 from upstream clang trunk (by Simon Pilgrim):
dim [Wed, 17 Aug 2016 21:57:11 +0000 (21:57 +0000)]
Pull in r262772 from upstream clang trunk (by Simon Pilgrim):

  [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE

  btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't
  support XSAVE.

  Differential Revision: http://reviews.llvm.org/D17682

Pull in r262782 from upstream llvm trunk (by Simon Pilgrim):

  [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE

  btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't
  support XSAVE.

  Differential Revision: http://reviews.llvm.org/D17683

This ensures clang does not emit AVX instructions for CPUTYPE=btver1.

Reported by: Michel Depeige <demik+freebsd@lostwave.net>
PR: 211864
MFC after: 3 days

7 years agoRename allwinner_machdep.{c.h} to aw_machdep.{c.h} as all allwinner source
manu [Wed, 17 Aug 2016 21:44:02 +0000 (21:44 +0000)]
Rename allwinner_machdep.{c.h} to aw_machdep.{c.h}  as all allwinner source
files are name aw_*

7 years agoboot1.efi Free() should check for NULL to provide consistent behavior
tsoome [Wed, 17 Aug 2016 21:29:57 +0000 (21:29 +0000)]
boot1.efi Free() should check for NULL to provide consistent behavior
with libstand Free().

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

7 years agoRename kernel config A10 into ALLWINNER_UP as it is intend to work with all
manu [Wed, 17 Aug 2016 20:32:08 +0000 (20:32 +0000)]
Rename kernel config A10 into ALLWINNER_UP as it is intend to work with all
Allwinner Uniprocessor SoC.
As of now it works with A10 and A13 (and possibly R8 as it is the same as the A13).
Move files.a10 into a1o subdirectory as it should be.
Rename std.a10 into std.allwinner_up

7 years agorights(4): CAP_FSYNC also permits fdatasync(2).
jilles [Wed, 17 Aug 2016 20:27:04 +0000 (20:27 +0000)]
rights(4): CAP_FSYNC also permits fdatasync(2).

7 years agomips/broadcom: Implement CFE-based EARLY_PRINTF support.
landonf [Wed, 17 Aug 2016 20:24:14 +0000 (20:24 +0000)]
mips/broadcom: Implement CFE-based EARLY_PRINTF support.

This adds support for EARLY_PRINTF via the CFE console; the aim is to
provide a fix for the otherwise cyclic dependency between PMU discovery
and console printf/DELAY:

- We need to parse the bhnd(4) core table to determine the address (and
  type) of the PMU/PLL registers and calculate the CPU clock frequency.
- The core table parsing code will emit a printf() if a parse error is
  hit.
- Safely calling printf() without EARLY_PRINTF requires a working
  DELAY+cninit, which means we need the PMU.

Errors in core table parsing shouldn't happen, but lack of EARLY_PRINTF
makes debugging more difficult.

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

7 years agoTeach netisr_get_cpuid() to limit a given value to supported by netisr.
ae [Wed, 17 Aug 2016 20:21:33 +0000 (20:21 +0000)]
Teach netisr_get_cpuid() to limit a given value to supported by netisr.
Use netisr_get_cpuid() in netisr_select_cpuid() to limit cpuid value
returned by protocol to be sure that it is not greather than nws_count.

PR: 211836
Reviewed by: adrian
MFC after: 3 days

7 years agoAdd sun5i-a13-olinuxino to the build.
manu [Wed, 17 Aug 2016 17:59:09 +0000 (17:59 +0000)]
Add sun5i-a13-olinuxino to the build.

7 years agoFix the output for scope statistics.
tuexen [Wed, 17 Aug 2016 16:56:20 +0000 (16:56 +0000)]
Fix the output for scope statistics.

MFC after: 3 days

7 years agoUse names for SCTP and UDPLite when reporting the input histogram.
tuexen [Wed, 17 Aug 2016 14:44:47 +0000 (14:44 +0000)]
Use names for SCTP and UDPLite when reporting the input histogram.

MFC after: 3 days

7 years agoRemove pullup settings for MMC pins, this is not needed since r304290
manu [Wed, 17 Aug 2016 13:19:28 +0000 (13:19 +0000)]
Remove pullup settings for MMC pins, this is not needed since r304290

MFC after: 1 week

7 years agoOnly set pud settings if this is a pullup or pulldown configuration.
manu [Wed, 17 Aug 2016 13:09:31 +0000 (13:09 +0000)]
Only set pud settings if this is a pullup or pulldown configuration.
This removes the need to set the MMC pins with pullups in our DTS.
Thanks to jmcneill@ for spotting this.

Tested on Orange Pi One (Allwinner H3).

MFC after: 1 week

7 years agoa10_gpio_get_function now returns the whole function not only
manu [Wed, 17 Aug 2016 10:20:36 +0000 (10:20 +0000)]
a10_gpio_get_function now returns the whole function not only
GPIO_INPUT/GPIO_OUTPUT.
a10_gpio_get_pud now returns the whole pud not only PULLDOWN/PULLUP.
Add a10_gpio_get_drv to get the current drive strenght.
During fdt pin configure, avoid setting function/drive/pud if it's already in
the correct value.

Tested on Allwinner H3 and A20

MFC after: 1 week

7 years agoGarbage collect _umtx_lock(2)/_umtx_unlock(2) references removed in r263318.
bdrewery [Wed, 17 Aug 2016 10:20:05 +0000 (10:20 +0000)]
Garbage collect _umtx_lock(2)/_umtx_unlock(2) references removed in r263318.

This has no real impact on the resulting libc.so file.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agoAdd fdatasync(2) man page, combined with fsync(2).
kib [Wed, 17 Aug 2016 10:16:42 +0000 (10:16 +0000)]
Add fdatasync(2) man page, combined with fsync(2).

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

7 years agoRemove duplicated code.
kib [Wed, 17 Aug 2016 10:14:22 +0000 (10:14 +0000)]
Remove duplicated code.

aio_aqueue() calls aio_init_aioinfo() as the first action. There is no
need to duplicate the code in kern_aio_fsync().

Also fix indent for aio_aqueue() definition.

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

7 years agoImplement userspace gettimeofday(2) with HPET timecounter.
kib [Wed, 17 Aug 2016 09:52:09 +0000 (09:52 +0000)]
Implement userspace gettimeofday(2) with HPET timecounter.

Right now, userspace (fast) gettimeofday(2) on x86 only works for
RDTSC.  For older machines, like Core2, where RDTSC is not C2/C3
invariant, and which fall to HPET hardware, this means that the call
has both the penalty of the syscall and of the uncached hw behind the
QPI or PCIe connection to the sought bridge.  Nothing can me done
against the access latency, but the syscall overhead can be removed.
System already provides mappable /dev/hpetX devices, which gives
straight access to the HPET registers page.

Add yet another algorithm to the x86 'vdso' timehands. Libc is updated
to handle both RDTSC and HPET.  For HPET, the index of the hpet device
to mmap is passed from kernel to userspace, index might be changed and
libc invalidates its mapping as needed.

Remove cpu_fill_vdso_timehands() KPI, instead require that
timecounters which can be used from userspace, to provide
tc_fill_vdso_timehands{,32}() methods.  Merge i386 and amd64
libc/<arch>/sys/__vdso_gettc.c into one source file in the new
libc/x86/sys location.  __vdso_gettc() internal interface is changed
to move timecounter algorithm detection into the MD code.

Measurements show that RDTSC even with the syscall overhead is faster
than userspace HPET access.  But still, userspace HPET is three-four
times faster than syscall HPET on several Core2 and SandyBridge
machines.

Tested by: Howard Su <howard0su@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D7473

7 years agoBy default, allow all to read the HPET registers pages. At the same
kib [Wed, 17 Aug 2016 09:20:04 +0000 (09:20 +0000)]
By default, allow all to read the HPET registers pages.  At the same
time, by, by default disallow writes to the mmaped HPET pages.

Intent is to allow userspace to use HPET as fast (i.e. no-syscall)
timecounter for gettimeofday(2).  Unfortunately, the permission model
does not make it possible to safely unhide /dev/hpet in the jails even
if default mode is set to 0444, because untrusted jailed root may
change device permissions to writeable.

Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

7 years agohyperv/util: Factor out helper for IC device_probe DEVMETHOD
sephe [Wed, 17 Aug 2016 08:38:49 +0000 (08:38 +0000)]
hyperv/util: Factor out helper for IC device_probe DEVMETHOD

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

7 years agoCorrectly print and cast u_int64_t and off_t.
manu [Wed, 17 Aug 2016 08:29:30 +0000 (08:29 +0000)]
Correctly print and cast u_int64_t and off_t.

Reported by: ed, imp
MFC after: 1 week

7 years agohyperv/util: Don't reference hn_softc in KVP
sephe [Wed, 17 Aug 2016 08:26:08 +0000 (08:26 +0000)]
hyperv/util: Don't reference hn_softc in KVP

hn_softc is private data struct.

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

7 years ago- Add the 'restrict' type qualifier to match function prototype.
kevlo [Wed, 17 Aug 2016 07:25:50 +0000 (07:25 +0000)]
- Add the 'restrict' type qualifier to match function prototype.
- Use .Lb libc rather than libpthread.

Reviewed by: delphij

7 years agohyperv/hn: Get rid of unused bits
sephe [Wed, 17 Aug 2016 05:57:10 +0000 (05:57 +0000)]
hyperv/hn: Get rid of unused bits

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

7 years agohyperv/hn: Remove reference to nvsp_status
sephe [Wed, 17 Aug 2016 05:45:57 +0000 (05:45 +0000)]
hyperv/hn: Remove reference to nvsp_status

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

7 years agohyperv/hn: Remove reference to nvsp_msg
sephe [Wed, 17 Aug 2016 05:34:02 +0000 (05:34 +0000)]
hyperv/hn: Remove reference to nvsp_msg

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

7 years agohyperv/hn: Simplify RNDIS RX packets acknowledgement.
sephe [Wed, 17 Aug 2016 05:25:47 +0000 (05:25 +0000)]
hyperv/hn: Simplify RNDIS RX packets acknowledgement.

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

7 years agohyperv/hn: Ignore the useless TX table.
sephe [Wed, 17 Aug 2016 05:14:26 +0000 (05:14 +0000)]
hyperv/hn: Ignore the useless TX table.

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

7 years agohyperv/storvsc: Deliver CAM_SEL_TIMEOUT upon SRB status error.
sephe [Wed, 17 Aug 2016 05:02:18 +0000 (05:02 +0000)]
hyperv/storvsc: Deliver CAM_SEL_TIMEOUT upon SRB status error.

SRB status is set to 0x20 by the hypervisor, if the specified LUN is
unaccessible, and even worse the INQUIRY response will not be set by
the hypervisor at all under this situation.  Additionally, SRB status
is 0x20 too, for TUR on an unaccessible LUN.

Deliver CAM_SEL_TIMEOUT to CAM upon SRB status errors as suggested by
Scott Long, other values seems improper.

This commit fixes the Hyper-V disk hotplug support.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7521

7 years agoAdd support for set/get cam search mode
davidcs [Wed, 17 Aug 2016 02:40:17 +0000 (02:40 +0000)]
Add support for set/get cam search mode

MFC after: 5 days

7 years agoAdd ql_minidump.h
davidcs [Wed, 17 Aug 2016 01:57:58 +0000 (01:57 +0000)]
Add ql_minidump.h

MFC after:5 days

7 years agoUpgrade fw, bootloader and minidump template to version 5.4.58
davidcs [Wed, 17 Aug 2016 01:56:37 +0000 (01:56 +0000)]
Upgrade fw, bootloader and minidump template to version 5.4.58
Add minidump retrieval code

MFC after: 5 days

7 years agoPCIe HotPlug: Detect bridges that are not really HotPlug capable
vangyzen [Wed, 17 Aug 2016 01:24:34 +0000 (01:24 +0000)]
PCIe HotPlug: Detect bridges that are not really HotPlug capable

Some devices report that they have an MRL when they actually
do not.  Since they always report that the MRL is open, child
devices would be ignored.  Try to detect these devices and
ignore their claim of HotPlug support.  Specifically,
if there is an open MRL but the Data Link Layer is active,
the MRL is not real.

Revert r303645 to re-enable HotPlug support for slots with
power controllers, since it works correctly in my testing.

Start the DLL state-change timer if Presence /or/ MRL state changes,
along with other conditions.  Previously, we started the timer iff
Presence changed.  If there is an MRL, it must be closed for power
to be turned on, so Presence is unlikely to change on an MRL-close event.

Add a printf() of interesting registers on HotPlug interrupts and
commands (one from erj@).  These were very useful for debugging.
Guard them with bootverbose, since they're spam in normal operation.

In collaboration with: jhb
Reviewed by: jhb
MFC after: 1 day
Relnotes: yes (re-enable HotPlug support for slots with power controllers)
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D7509

7 years agoFix a stupid typo (or copy/paste buffer malfunction).
glebius [Tue, 16 Aug 2016 23:00:22 +0000 (23:00 +0000)]
Fix a stupid typo (or copy/paste buffer malfunction).

7 years agoWe should not be allowing a timeout to reset when a drain is in progress on
glebius [Tue, 16 Aug 2016 21:55:34 +0000 (21:55 +0000)]
We should not be allowing a timeout to reset when a drain is in progress on
it (either async or sync drain).

At this moment the only user of drain is TCP, but TCP wouldn't reschedule a
callout after it has drained it, since it drains only when a tcpcb is closed.
This for now the problem isn't observed.

Submitted by: rrs

7 years agobhnd(4): Implement NVRAM support required for PMU bring-up.
landonf [Tue, 16 Aug 2016 21:32:05 +0000 (21:32 +0000)]
bhnd(4): Implement NVRAM support required for PMU bring-up.

- Added a generic bhnd_nvram_parser API, with support for the TLV format
  used on WGT634U devices, the standard BCM NVRAM format used on most
  modern devices, and the "board text file" format used on some hardware
  to supply external NVRAM data at runtime (e.g. via an EFI variable).

- Extended the bhnd_bus_if and bhnd_nvram_if interfaces to support both
  string-based and primitive data type variable access, required for
  common behavior across both SPROM and NVRAM data sources.
- Extended the existing SPROM implementation to support the new
  string-based NVRAM APIs.

- Added an abstract bhnd_nvram driver, implementing the bhnd_nvram_if
  atop the bhnd_nvram_parser API.
- Added a CFE-based bhnd_nvram driver to provide read-only access to
  NVRAM data on MIPS SoCs, pending implementation of a flash-aware
  bhnd_nvram driver.

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

7 years agobhndb(4): Drop MIPS-incompatible __builtin_ctz dependency.
landonf [Tue, 16 Aug 2016 21:20:05 +0000 (21:20 +0000)]
bhndb(4): Drop MIPS-incompatible __builtin_ctz dependency.

This replaces the bitfield representation of the bhndb register window
freelist with the bitstring API, eliminating a dependency on
(MIPS-unsupported) __builtin_ctz().

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

7 years agoBug 211013 reports that a write error to a UFS filesystem running
mckusick [Tue, 16 Aug 2016 21:02:30 +0000 (21:02 +0000)]
Bug 211013 reports that a write error to a UFS filesystem running
with softupdates panics the kernel. The problem that has been pointed
out is that when there is a transient write error on certain metadata
blocks, specifically directory blocks (PAGEDEP), inode blocks
(INODEDEP), indirect pointer blocks (INDIRDEPS), and cylinder group
(BMSAFEMAP, but only when journaling is enabled), we get a panic
in one of the routines called by softdep_disk_io_initiation that
the I/O is "already started" when we retry the write.

These dependency types potentially need to do roll-backs when called
by softdep_disk_io_initiation before doing a write and then a
roll-forward when called by softdep_disk_write_complete after the
I/O completes.  The panic happens when there is a transient error.
At the top of softdep_disk_write_complete we check to see if the
write had an error and if an error occurred we just return.  This
return is correct most of the time because the main role of the routines
called by softdep_disk_write_complete is to process the now-completed
dependencies so that the next I/O steps can happen.

But for the four types listed above, they do not get to do their
rollback operations. This causes the panic when softdep_disk_io_initiation
gets called on the second attempt to do the write and the roll-back
routines find that the roll-backs have already been done. As an
aside I note that there is also the problem that the buffer will
have been unlocked and thus made visible to the filesystem and to
user applications with the roll-backs in place.

The way to resolve the problem is to add a flag to the routines called
by softdep_disk_write_complete for the four dependency types noted
that indicates whether the write was successful (WRITESUCCEEDED).
If the write does not succeed, they do just the roll-backs and then
return. If the write was successful they also do their usual
processing of the now-completed dependencies.

The fix was tested by selectively injecting write errors for buffers
holding dependencies of each of the four types noted above and then
verifying that the kernel no longer paniced and that following the
successful retry of the write that the filesystem could be unmounted
and successfully checked cleanly.

PR: 211013
Reviewed by: kib

7 years agoOnly expect :encode_tv_random_million to fail on 64-bit platforms
ngie [Tue, 16 Aug 2016 20:35:36 +0000 (20:35 +0000)]
Only expect :encode_tv_random_million to fail on 64-bit platforms

It passes on i386

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoRemove prototypes missed in r303951.
markj [Tue, 16 Aug 2016 19:43:17 +0000 (19:43 +0000)]
Remove prototypes missed in r303951.

7 years agoIn UFS_BALLOC(), invalidate pages of indirect buffers on failed block
kib [Tue, 16 Aug 2016 17:30:58 +0000 (17:30 +0000)]
In UFS_BALLOC(), invalidate pages of indirect buffers on failed block
allocation unwinding.

Dandling buffers are released on UFS_BALLOC() failure to ensure that
later attempt to allocate blocks in close range do not find the blocks
with invalid content, since possible partial block allocations are
unwound.  As such, it is not enough to just release the buffers, the
pages must also invalidated and removed from the vnode vm_object
queue.  Otherwise the pages might be found later and used to
reconstruct indirect buffers when doing allocations at offset close to
the failure point, and their stale content compromise the filesystem
integrity.

Note that just marking the buffer as B_INVAL is not enough, B_NOCACHE
is required.  To be sure, clear the B_CACHE flag as well.  This
complements the r174973, which started releasing buffers.

Reported and tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoOn unwind after failed block allocation in ffs_balloc_ufs{1,2}, assert
kib [Tue, 16 Aug 2016 17:18:38 +0000 (17:18 +0000)]
On unwind after failed block allocation in ffs_balloc_ufs{1,2}, assert
that recorded allocated blocks numbers match the physical block
numbers of dandling buffers which are released.

When finally freeing the blocks during unwind, assert that dandling
buffers where not re-allocated.  They shouldn't, because the vnode lock
is owned exclusive.

Reviewed by: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd two new macros, SLIST_CONCAT and LIST_CONCAT. Note in both the
mckusick [Tue, 16 Aug 2016 17:07:48 +0000 (17:07 +0000)]
Add two new macros, SLIST_CONCAT and LIST_CONCAT. Note in both the
queue.h header file and in the queue.3 manual page that they are O(n)
so should be used only in low-usage paths with short lists (otherwise
an STAILQ or TAILQ should be used).

Reviewed by: kib

7 years agoWhen looking up dandling buffers for unwing after failing block
kib [Tue, 16 Aug 2016 17:05:15 +0000 (17:05 +0000)]
When looking up dandling buffers for unwing after failing block
allocation in UFS_BALLOC(), there is no need to map them.

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

7 years agoWhen block allocation fails in UFS_BALLOC(), and the volume does not
kib [Tue, 16 Aug 2016 16:50:48 +0000 (16:50 +0000)]
When block allocation fails in UFS_BALLOC(), and the volume does not
have SU enabled, there is no point in calling softdep_request_cleanup().

The call cannot produce free blocks, but we unecessarily lock ufsmount
and do inode block write.  Usual point of not doing optimizations for
the corner case of the full volume is not applicable there, the work
is easily avoidable, and the addition CPU and disk io load do not lead
to succeeding retry.

Reviewed by: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoIn ffs_balloc_ufs{1,2} routines, assert that unwind records do not
kib [Tue, 16 Aug 2016 16:49:56 +0000 (16:49 +0000)]
In ffs_balloc_ufs{1,2} routines, assert that unwind records do not
overflow local arrays.  This is not immediately obvious from the
static code inspection, due to retry logic.

Reviewed by: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUse nitems() from sys/param.h.
araujo [Tue, 16 Aug 2016 15:53:05 +0000 (15:53 +0000)]
Use nitems() from sys/param.h.

MFC after: 2 weeks.

7 years agoUse nitems() from sys/param.h.
araujo [Tue, 16 Aug 2016 15:52:10 +0000 (15:52 +0000)]
Use nitems() from sys/param.h.

MFC after: 2 weeks.