]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoRegenerate system call table after r297468.
Ed Schouten [Thu, 31 Mar 2016 18:50:52 +0000 (18:50 +0000)]
Regenerate system call table after r297468.

8 years agoSync in the latest CloudABI system call definitions.
Ed Schouten [Thu, 31 Mar 2016 18:50:06 +0000 (18:50 +0000)]
Sync in the latest CloudABI system call definitions.

Some time ago I made a change to merge together the memory scope
definitions used by mmap (MAP_{PRIVATE,SHARED}) and lock objects
(PTHREAD_PROCESS_{PRIVATE,SHARED}). Though that sounded pretty smart
back then, it's backfiring. In the case of mmap it's used with other
flags in a bitmask, but for locking it's an enumeration. As our plan is
to automatically generate bindings for other languages, that looks a bit
sloppy.

Change all of the locking functions to use separate flags instead.

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

8 years agoRemove #ifdef's from various structures used in the cxgbe/cxl driver.
John Baldwin [Thu, 31 Mar 2016 18:36:50 +0000 (18:36 +0000)]
Remove #ifdef's from various structures used in the cxgbe/cxl driver.

This provides a constant ABI and layout for these structures (especially
struct adapter) avoiding some foot shooting.

Discussed with: np
Sponsored by: Chelsio Communications

8 years agoRework handling of thread sleeps before timers are working.
John Baldwin [Thu, 31 Mar 2016 18:10:29 +0000 (18:10 +0000)]
Rework handling of thread sleeps before timers are working.

Previously, calls to *sleep() and cv_*wait*() immediately returned during
early boot.  Instead, permit threads that request a sleep without a
timeout to sleep as wakeup() works during early boot.  Sleeps with
timeouts are harder to emulate without working timers, so just punt and
panic explicitly if any thread tries to use those before timers are
working.  Any threads that depend on timeouts should either wait until
SI_SUB_KICK_SCHEDULER to start or they should use DELAY() until timers
are available.

Until APs are started earlier this should be a no-op as other kthreads
shouldn't get a chance to start running until after timers are working
regardless of when they were created.

Reviewed by: kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D5724

8 years agoRefactor; no functional changes.
Edward Tomasz Napierala [Thu, 31 Mar 2016 17:32:28 +0000 (17:32 +0000)]
Refactor; no functional changes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoTidy up the unmapped I/O code in qphysio.
John Baldwin [Thu, 31 Mar 2016 17:27:30 +0000 (17:27 +0000)]
Tidy up the unmapped I/O code in qphysio.

- Move some blocks around to reduce the number of 'if (unmap)' checks.
- Use 'pbuf == NULL' instead of 'unmap'.
- Use nitems.
- Pull an assignment out of an if expression.

Reviewed by: kib
Sponsored by: Chelsio Communications

8 years agoWITHOUT_TOOLCHAIN: Skip building of h_raw.
Bryan Drewery [Thu, 31 Mar 2016 17:27:17 +0000 (17:27 +0000)]
WITHOUT_TOOLCHAIN: Skip building of h_raw.

-fsanitize does not seem to work when a --sysroot is specified and there
is no <sysroot>/usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.ubsan_standalone-*.a.

Sponsored by: EMC / Isilon Storage Division

8 years agoLIB32+WITHOUT_TOOLCHAIN: Fix build by staging includes.
Bryan Drewery [Thu, 31 Mar 2016 17:27:14 +0000 (17:27 +0000)]
LIB32+WITHOUT_TOOLCHAIN: Fix build by staging includes.

This is the same fix as r297281 for the normal build.

Sponsored by: EMC / Isilon Storage Division

8 years agoWITHOUT_TOOLCHAIN: Fix build of rtld.
Bryan Drewery [Thu, 31 Mar 2016 17:27:01 +0000 (17:27 +0000)]
WITHOUT_TOOLCHAIN: Fix build of rtld.

MK_TOOLCHAIN==no disables building and installing of pic archives.
c_pic.a is still needed for rtld though so force it to build in lib/libc
and link directly to the objdir version of it for rtld.

Somehow this has been broken since r148725.

Sponsored by: EMC / Isilon Storage Division

8 years agoImprove comments.
Edward Tomasz Napierala [Thu, 31 Mar 2016 17:15:03 +0000 (17:15 +0000)]
Improve comments.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoAdd wait_event_interruptible_timeout to linuxkpi.
Navdeep Parhar [Thu, 31 Mar 2016 17:11:58 +0000 (17:11 +0000)]
Add wait_event_interruptible_timeout to linuxkpi.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Reviewed by: hselasky@
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D5776

8 years agoFix overflows, making it impossible to add negative amounts using rctl(8).
Edward Tomasz Napierala [Thu, 31 Mar 2016 17:00:47 +0000 (17:00 +0000)]
Fix overflows, making it impossible to add negative amounts using rctl(8).

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix number of the enabled VFs in VNIC
Zbigniew Bodek [Thu, 31 Mar 2016 16:44:32 +0000 (16:44 +0000)]
Fix number of the enabled VFs in VNIC

nic->num_vf_en is set based on the number of the enabled LMACs.
This number should not be overwritten later by any routine.
Instead it should fail PCI_IOV_ADD_VF() so that available VFs
with the corresponding LMACs will attach whereas other, disabled
VFs will fail with the proper error code.
Error signaling (due to improper number of VFs requested) is also moved
from PCI_IOV_INIT() to PCI_IOV_ADD_VF().

This will be reworked when multiple queue sets are enabled but for
now this is the correct behavior of the driver.

Obtained from: Semihalf
Sponsored by:  Cavium

8 years agoWe don't support DPLIBS.
Bryan Drewery [Thu, 31 Mar 2016 16:09:59 +0000 (16:09 +0000)]
We don't support DPLIBS.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix minor problems caught by mandoc -Tlint.
Christian Brueffer [Thu, 31 Mar 2016 15:16:22 +0000 (15:16 +0000)]
Fix minor problems caught by mandoc -Tlint.

8 years agoDefine OBJTOP earlier if possible for use in targets.
Bryan Drewery [Thu, 31 Mar 2016 14:48:17 +0000 (14:48 +0000)]
Define OBJTOP earlier if possible for use in targets.

Sponsored by: EMC / Isilon Storage Division

8 years agoDon't omit m_dup() for non-writeable mbufs that need checksum calculation
Zbigniew Bodek [Thu, 31 Mar 2016 13:23:43 +0000 (13:23 +0000)]
Don't omit m_dup() for non-writeable mbufs that need checksum calculation

If the driver is not active or link is down the packet could remain
non-writeable. This commit makes all mbufs enqueued to the driver's
ring buffer to have correct attributes.

Pointed out by: wma
Reviewed by:    wma
Obtained from:  Semihalf
Sponsored by:   Cavium
Differential Revision: https://reviews.freebsd.org/D5800

8 years agoRemove NULL checks after M_WAITOK allocations, which - by definition - can
Edward Tomasz Napierala [Thu, 31 Mar 2016 13:20:02 +0000 (13:20 +0000)]
Remove NULL checks after M_WAITOK allocations, which - by definition - can
never return NULL.

Reviewed by: arybchik@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5773

8 years agoFix MAC address configuration for VNIC
Zbigniew Bodek [Thu, 31 Mar 2016 13:13:38 +0000 (13:13 +0000)]
Fix MAC address configuration for VNIC

The FDT description is as follows:
- phy-handle, reg, qlm-mode, mac-address are under nodes in bgx0/1 node
- phy nodes (pointed by phy-handle) are under MDIO even though they may
  not be connected through to MDIO. In those nodes they do not contain
  MAC address or etc.

This commit changes parsing of the FDT nodes for BGX so that it can
obtain correct MAC address for a given PHY.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5781

8 years agoImprove TX path of the VNIC driver
Zbigniew Bodek [Thu, 31 Mar 2016 13:10:29 +0000 (13:10 +0000)]
Improve TX path of the VNIC driver

- Avoid memory leak when nicvf_tx_mbuf_locked() fails
- Introduce nicvf_xmit_locked() routine that uses drbr_peek(),
  drbr_advance() or drbr_putback() for a specific ifnet.
  This gives more clear and efficient design as well as
  prevents from dropping mbufs that where not sent due to temporary
  lack of descriptors.
- Add missing ETHER_BPF_MTAP() hook

Pointed out by: yongari
Reviewed by:    wma
Obtained from:  Semihalf
Sponsored by:   Cavium
Differential Revision: https://reviews.freebsd.org/D5534

8 years agoFix whois queries for ARIN AS numbers.
Tony Finch [Thu, 31 Mar 2016 12:13:01 +0000 (12:13 +0000)]
Fix whois queries for ARIN AS numbers.

The ARIN whois server likes AS number queries to be in the form
"a 8075" rather than "as7085".

8 years agoFix typo in the VNIC's PF function name
Zbigniew Bodek [Thu, 31 Mar 2016 12:10:17 +0000 (12:10 +0000)]
Fix typo in the VNIC's PF function name

Should be add_vf not addr_vf.

8 years agoDisable MSI-x for AHCI on Alpine plattform
Zbigniew Bodek [Thu, 31 Mar 2016 11:18:52 +0000 (11:18 +0000)]
Disable MSI-x for AHCI on Alpine plattform

Changes introduced to AHCI code adding support for MSI-x
caused interrupt storm on Alpine boards.
This is unintended behaviour so added quirk to omit this functionality.

Reviewed by:   mav
Submitted by:  Marcin Mazurek <mma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Annapurna Labs
Differential Revision: https://reviews.freebsd.org/D4301

8 years agoAdd support for 4 level pagetables. The userland address space has been
Andrew Turner [Thu, 31 Mar 2016 11:07:24 +0000 (11:07 +0000)]
Add support for 4 level pagetables. The userland address space has been
increased to 256TiB. The kernel address space can also be increased to be
the same size, but this will be performed in a later change.

To help work with an extra level of page tables two new functions have
been added, one to file the lowest level table entry, and one to find the
block/page level. Both of these find the entry for a given pmap and virtual
address.

This has been tested with a combination of buildworld, stress2 tests, and
by using sort to consume a large amount of memory by sorting /dev/zero. No
new issues are known to be present from this change.

Reviewed by: kib
Obtained from: ABT Systems Ltd
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5720

8 years agoFix bugs in currently unused bit searching loop.
Hans Petter Selasky [Thu, 31 Mar 2016 06:19:15 +0000 (06:19 +0000)]
Fix bugs in currently unused bit searching loop.

MFC after: 3 days
Sponsored by: Mellanox Technologies

8 years agoAdd support for the Nuvoton NCT5104D.
Adrian Chadd [Thu, 31 Mar 2016 04:57:38 +0000 (04:57 +0000)]
Add support for the Nuvoton NCT5104D.

Make it compile only for i386/amd64 for now as it's been tested there.
It's quite possible it'll show up elsewhere and we can enable it
for other architectures later.

Tested:

* PC Engines APU1C4

Submitted by: Daniel Wyatt <daniel@dewyatt.com>
Reviewed by: adrian, loos
Differential Revision: https://reviews.freebsd.org/D5389

8 years agohosttools: Trim unneeded directories.
Bryan Drewery [Thu, 31 Mar 2016 03:04:26 +0000 (03:04 +0000)]
hosttools: Trim unneeded directories.

These should only be build tools that are in various Makefile.depend
as host dependencies.  Anything toolchain related is handled by
toolchain and bootstrap-tools currently.

Sponsored by: EMC / Isilon Storage Division

8 years agorestore(8): fix use of uninitialized value.
Pedro F. Giffuni [Thu, 31 Mar 2016 02:01:11 +0000 (02:01 +0000)]
restore(8): fix use of uninitialized value.

Prevent uninitialized use of scalar newvol when jumping to gethdr.

CID: 1006491

8 years agoUnbreak the RSS/PCBGROUp build.
George V. Neville-Neil [Thu, 31 Mar 2016 00:53:23 +0000 (00:53 +0000)]
Unbreak the RSS/PCBGROUp build.

8 years agoDIRDEPS_BUILD: Don't reset OBJROOT in sub-makes.
Bryan Drewery [Thu, 31 Mar 2016 00:26:40 +0000 (00:26 +0000)]
DIRDEPS_BUILD: Don't reset OBJROOT in sub-makes.

MAKEOBJDIRPREFIX is set to blank and exported from MAKELEVEL0 along
with OBJROOT exported.  In sub-makes OBJROOT is recalculated with
an empty MAKEOBJDIRPREFIX though.

Sponsored by: EMC / Isilon Storage Division

8 years agoRegenerate
Bryan Drewery [Wed, 30 Mar 2016 23:56:43 +0000 (23:56 +0000)]
Regenerate

8 years agoRemove FAST_DEPEND reference missed in r297434.
Bryan Drewery [Wed, 30 Mar 2016 23:53:12 +0000 (23:53 +0000)]
Remove FAST_DEPEND reference missed in r297434.

8 years agoFix the external GCC build after r297271 by setting -L <sysroot>/usr/lib.
Bryan Drewery [Wed, 30 Mar 2016 23:50:29 +0000 (23:50 +0000)]
Fix the external GCC build after r297271 by setting -L <sysroot>/usr/lib.

GCC does add <sysroot>/usr/lib to the library search path but it comes after
/usr/local/lib which can find ports libraries such as libedit.so.  The
bad path comes in as /usr/local/lib/gcc/x86_64-portbld-freebsd11.0/5.3.0/../../../
which corresponds to <prefix>/lib.

This partially reverts r297271.

Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove the old depend (mkdep) code and make FAST_DEPEND the one true way.
Bryan Drewery [Wed, 30 Mar 2016 23:50:23 +0000 (23:50 +0000)]
Remove the old depend (mkdep) code and make FAST_DEPEND the one true way.

Reviewed by: emaste, hselasky (partial), brooks (brief)
Discussed on: arch@
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5742

8 years agoshow-valid-targets: Indent each target 2 spaces.
Bryan Drewery [Wed, 30 Mar 2016 22:26:14 +0000 (22:26 +0000)]
show-valid-targets: Indent each target 2 spaces.

Sponsored by: EMC / Isilon Storage Division

8 years agoRemove redundant code imported into dirdeps.mk in r290956.
Bryan Drewery [Wed, 30 Mar 2016 21:31:34 +0000 (21:31 +0000)]
Remove redundant code imported into dirdeps.mk in r290956.

Sponsored by: EMC / Isilon Storage Division

8 years agoshow-valid-targets: Organize all targets by the all_machine_list.
Bryan Drewery [Wed, 30 Mar 2016 18:55:58 +0000 (18:55 +0000)]
show-valid-targets: Organize all targets by the all_machine_list.

Sponsored by: EMC / Isilon Storage Division

8 years agoMove hosttools to Makefile.depend.host so it shows under host targets in show-valid...
Bryan Drewery [Wed, 30 Mar 2016 18:40:09 +0000 (18:40 +0000)]
Move hosttools to Makefile.depend.host so it shows under host targets in show-valid-targets.

Sponsored by: EMC / Isilon Storage Division

8 years agoshow-valid-targets: Show host targets and also order all of the targets.
Bryan Drewery [Wed, 30 Mar 2016 18:39:41 +0000 (18:39 +0000)]
show-valid-targets: Show host targets and also order all of the targets.

Sponsored by: EMC / Isilon Storage Division

8 years agoEnable SPI1 on Beaglebone Black.
Luiz Otavio O Souza [Wed, 30 Mar 2016 17:32:14 +0000 (17:32 +0000)]
Enable SPI1 on Beaglebone Black.

SPI1 was chosen because SPI0 shares the gpio pins with I2C1.

Sponsored by: Rubicon Communications (Netgate)

8 years agoUse the AM33XX_IOPAD() MACRO which is easier to read (uses the same offset
Luiz Otavio O Souza [Wed, 30 Mar 2016 17:18:49 +0000 (17:18 +0000)]
Use the AM33XX_IOPAD() MACRO which is easier to read (uses the same offset
of TRM).

While here remove i2c2_pins, it is already defined in
am335x-bone-common.dtsi.

Sponsored by: Rubicon Communications (Netgate)

8 years agoUse osd_reserve / osd_jail_set_reserved, which is known to succeed.
Jamie Gritton [Wed, 30 Mar 2016 17:05:04 +0000 (17:05 +0000)]
Use osd_reserve / osd_jail_set_reserved, which is known to succeed.
Also don't work around nonexistent osd_register failure.

8 years agoAdd basic FDT support for the mx25l SPI flash.
Luiz Otavio O Souza [Wed, 30 Mar 2016 17:00:33 +0000 (17:00 +0000)]
Add basic FDT support for the mx25l SPI flash.

Sponsored by: Rubicon Communications (Netgate)

8 years agoAdd osd_reserve() and osd_set_reserved(), which allow M_WAITOK allocation
Jamie Gritton [Wed, 30 Mar 2016 16:57:28 +0000 (16:57 +0000)]
Add osd_reserve() and osd_set_reserved(), which allow M_WAITOK allocation
of an OSD array,

8 years agoPlug open count leak on zvol rename.
Alexander Motin [Wed, 30 Mar 2016 16:54:18 +0000 (16:54 +0000)]
Plug open count leak on zvol rename.

MFC after: 2 weeks

8 years agoSwitch from using make_dev_p() to make_dev_s() to close races.
Alexander Motin [Wed, 30 Mar 2016 16:48:57 +0000 (16:48 +0000)]
Switch from using make_dev_p() to make_dev_s() to close races.

8 years agoBump up the read and write timeouts. The old value was too small for low
Luiz Otavio O Souza [Wed, 30 Mar 2016 16:26:00 +0000 (16:26 +0000)]
Bump up the read and write timeouts.  The old value was too small for low
speed transfers.

Sponsored by: Rubicon Communications (Netgate)

8 years agolibc: stop exporting cerror
Ed Maste [Wed, 30 Mar 2016 14:42:09 +0000 (14:42 +0000)]
libc: stop exporting cerror

i386 stopped exporting .cerror in r240152, and likewise for amd64 in
r240178. It is not used by other libraries on any platform, so apply
the same change to the remaining architectures.

Reviewed by: jhibbits, jilles
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5774

8 years agofreopen(3): prevent uninitialized errno.
Pedro F. Giffuni [Wed, 30 Mar 2016 13:26:35 +0000 (13:26 +0000)]
freopen(3): prevent uninitialized errno.

Revert completley r297408 (and r297407): this ends up touching errno,
which we are not allowed to do.

Pointed out by: ache, bde

8 years agoAdd new USB ID to UDL driver.
Hans Petter Selasky [Wed, 30 Mar 2016 10:05:52 +0000 (10:05 +0000)]
Add new USB ID to UDL driver.

Submitted by: Matthias Petermann <matthias@petermann-it.de>
PR: 201084

8 years ago[bwn] fix time_before -> ieee80211_time_before()
Adrian Chadd [Wed, 30 Mar 2016 06:48:09 +0000 (06:48 +0000)]
[bwn] fix time_before -> ieee80211_time_before()

Noticed by: Jia-Shiun Li <jiashiun@gmail.com>

8 years agofreopen(3): prevent uninitialized errno.
Pedro F. Giffuni [Wed, 30 Mar 2016 06:13:58 +0000 (06:13 +0000)]
freopen(3): prevent uninitialized errno.

Revert r297407 and redo it cleanly.

Pointed out by: Jukka A. Ukkonen
CID: 1018720
MFC after: 1 week

8 years agofreopen(3): prevent uninitialized errno.
Pedro F. Giffuni [Wed, 30 Mar 2016 01:32:08 +0000 (01:32 +0000)]
freopen(3): prevent uninitialized errno.

The case doesn't look very likely but clean the possibility nevertheless

CID: 1018720
MFC after: 1 week

8 years agoRemove unnecessary dequeue_mutex (added in r294610) from the iWARP
Navdeep Parhar [Wed, 30 Mar 2016 01:08:08 +0000 (01:08 +0000)]
Remove unnecessary dequeue_mutex (added in r294610) from the iWARP
connection manager.  Examining so_comp without synchronization with
iw_so_event_handler is a harmless race.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Reviewed by: Steve Wise @ Open Grid Computing
Sponsored by: Chelsio Communications

8 years ago[net80211] migrate the time_* macros to ieee80211_* namespace.
Adrian Chadd [Wed, 30 Mar 2016 00:44:10 +0000 (00:44 +0000)]
[net80211] migrate the time_* macros to ieee80211_* namespace.

It turns out that these will clash very annoyingly with the linux
macros in the linuxkpi layer, so let the wookie^Wlinux win.

The only user that I can find is ath(4), so fix it there too.

8 years ago[net80211] Add fields to decode uAPSD fields.
Adrian Chadd [Wed, 30 Mar 2016 00:42:18 +0000 (00:42 +0000)]
[net80211] Add fields to decode uAPSD fields.

It turns out that madwifi actually has the basics for uAPSD implemented
but it was never ported to FreeBSD.  I may eventually port most of the
pieces; I'll see how it goes!

Obtained from: Madwifi

8 years agoFix the lladdr copy in in6_lltable_dump_entry() after r292978.
Mark Johnston [Wed, 30 Mar 2016 00:03:59 +0000 (00:03 +0000)]
Fix the lladdr copy in in6_lltable_dump_entry() after r292978.

This bug caused "ndp -a" to show the wrong link layer address for neighbour
cache entries.

PR: 208067

8 years agoSmall typo.
Pedro F. Giffuni [Tue, 29 Mar 2016 23:33:44 +0000 (23:33 +0000)]
Small typo.

8 years agoDo not access buffer if bread(9) or cluster_read(9) failed. On error,
Konstantin Belousov [Tue, 29 Mar 2016 19:59:44 +0000 (19:59 +0000)]
Do not access buffer if bread(9) or cluster_read(9) failed.  On error,
the functions free the buffer and set the pointer to NULL.  Also
remove useless call to brelse(9) on the error path.

PR: 208275
Submitted by: Fabian Keil <fk@fabiankeil.de>
MFC after: 2 weeks

8 years agoThe sendfile(2) allows to send extra data from userspace before the file
Gleb Smirnoff [Tue, 29 Mar 2016 19:57:11 +0000 (19:57 +0000)]
The sendfile(2) allows to send extra data from userspace before the file
data (headers).  Historically the size of the headers was not checked
against the socket buffer space.  Application could easily overcommit the
socket buffer space.

With the new sendfile (r293439) the problem remained, but a KASSERT was
inserted that checked that amount of data written to the socket matches
its space.  In case when size of headers is bigger that socket space,
KASSERT fires.  Without INVARIANTS the new sendfile won't panic, but
would report incorrect amount of bytes sent.

o With this change, the headers copyin is moved down into the cycle, after
  the sbspace() check.  The uio size is trimmed by socket space there,
  which fixes the overcommit problem and its consequences.
o The compatibility handling for FreeBSD 4 sendfile headers API is pushed
  up the stack to syscall wrappers.  This required a copy and paste of the
  code, but in turn this allowed to remove extra stack carried parameter
  from fo_sendfile_t, and embrace entire compat code into #ifdef.  If in
  future we got more fo_sendfile_t function, the copy and paste level would
  even reduce.

Reviewed by: emax, gallatin, Maxim Dounin <mdounin mdounin.ru>
Tested by: Vitalij Satanivskij <satan ukr.net>
Sponsored by: Netflix

8 years agoType of the interrupt handlers on x86 cannot be expressed in C.
Konstantin Belousov [Tue, 29 Mar 2016 19:56:48 +0000 (19:56 +0000)]
Type of the interrupt handlers on x86 cannot be expressed in C.
Simplify and unify placeholder type definitions.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D5771

8 years agoFix several bugs in r297374:
Konstantin Belousov [Tue, 29 Mar 2016 19:54:13 +0000 (19:54 +0000)]
Fix several bugs in r297374:
- fix UP build [1]
- do not obliterate initial reading of rdtsc by the loop counter [2]
- restore the meaning of the argument -1 to native_lapic_ipi_wait()
  as wait until LAPIC acknowledge without timeout
- correct formula for calculating loop iteration count for 1us, it was
  inverted, and ensure that even on unlikely slow CPUs at least one
  check for ack is performed.

Reported by: Michael Butler <imb@protected-networks.net> [1], rpokala[2],
jhb[3]
Tested by: Michael Butler
Pointy hat to: kib
Sponsored by: The FreeBSD Foundation

8 years agoModify nd6_llinfo_timer() to acquire the nd6 lock before the LLE lock.
Mark Johnston [Tue, 29 Mar 2016 19:23:00 +0000 (19:23 +0000)]
Modify nd6_llinfo_timer() to acquire the nd6 lock before the LLE lock.

When expiring a neighbour cache entry we may need to look up the associated
default router, which requires the nd6 read lock. To avoid an LOR, the nd6
lock should be acquired first.

X-MFC-With: r296063
Tested by: Larry Rosenman <ler@lerctr.org> (previous revision)

8 years agoModify "4958 zdb trips assert on pools with ashift >= 0xe".
Alexander Motin [Tue, 29 Mar 2016 19:18:34 +0000 (19:18 +0000)]
Modify "4958 zdb trips assert on pools with ashift >= 0xe".

Unlike Illumos FreeBSD has concept of logical ashift, that specifies
really minimal vdev block size that can be accessed.  This knowledge
allows properly pad physical I/O and correctly assert its alignment.

This change fixes L2ARC write errors when device has logical sector
size above 512 bytes.

MFC after: 1 month

8 years agoAdd the SPI driver for am335x.
Luiz Otavio O Souza [Tue, 29 Mar 2016 19:11:04 +0000 (19:11 +0000)]
Add the SPI driver for am335x.

This driver works in PIO mode for now, interrupts are available only when
FIFO is enabled.  The FIFO cannot be used with arbitrary sizes which defeat
its general use.

At some point we can add DMA transfers where the FIFO can be more useful.

Tested on uBMC (microBMC) and BBB.

Sponsored by: Rubicon Communications (Netgate)

8 years agoReword descriptions of asserting locks held without WITNESS.
Bryan Drewery [Tue, 29 Mar 2016 16:07:51 +0000 (16:07 +0000)]
Reword descriptions of asserting locks held without WITNESS.

This corrects an error in r296947 in that it is not possible to assert
which thread holds a shared (or read) lock, but it is possible to assert
that one is held.  Just not very useful.

MFC after: 1 week
Submitted by: wblock, jhb
Reviewed by: kib (earlier version), jhb, wblock
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5659

8 years agoUse proper kern.opts.mk rather than src.opts.mk from r297058.
Bryan Drewery [Tue, 29 Mar 2016 15:26:53 +0000 (15:26 +0000)]
Use proper kern.opts.mk rather than src.opts.mk from r297058.

Reported by: kib
Sponsored by: EMC / Isilon Storage Division

8 years agoReduce OFW PCI code duplication - involves ARM, PPC and SPARC64
Zbigniew Bodek [Tue, 29 Mar 2016 15:19:56 +0000 (15:19 +0000)]
Reduce OFW PCI code duplication - involves ARM, PPC and SPARC64

Import portions of the PowerPC OF PCI implementation into new file
"ofwpci.c", common for other platforms. The files ofw_pci.c and ofw_pci.h
from sys/powerpc/ofw no longer exist. All required declarations are moved
to sys/dev/ofw/ofwpci.h. This creates a new ofw_pci_write_ivar() function
and modifies some others methods. Most functions contain existing ppc
implementations in the majority unchanged. Now there is no need to have
multiple identical copies of methods for various architectures.

Requested by:  jhibbits
Reviewed by:   jhibbits, marius
Submitted by:  Marcin Mazurek <mma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Annapurna Labs
Differential Revision: https://reviews.freebsd.org/D4879

8 years agoRemove some NULL checks for M_WAITOK allocations.
Edward Tomasz Napierala [Tue, 29 Mar 2016 13:56:59 +0000 (13:56 +0000)]
Remove some NULL checks for M_WAITOK allocations.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRead the CPU ID for the current CPU from the GIC. The GIC may have a
Andrew Turner [Tue, 29 Mar 2016 13:51:26 +0000 (13:51 +0000)]
Read the CPU ID for the current CPU from the GIC. The GIC may have a
different ID space than the kernel. Because of this we need to read the
ID from the hardware. The hardware will provide this value to the CPU by
reading any of the first 8 Interrupt Processor Targets Registers.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5706

8 years agoImprove HW checksums support in VNIC
Zbigniew Bodek [Tue, 29 Mar 2016 13:31:09 +0000 (13:31 +0000)]
Improve HW checksums support in VNIC

- Do not mark CSUM_IP_CHECKED and CSUM_IP_VALID on IPv6 packets.
  IPv6 does not have checksums by definition.
- Set SCTP packets csum_flags CSUM_SCTP_VALID instead of
  CSUM_DATA_VALID and skip csum_data
- Set csum_data simply as 0xffff without byteswap

Pointed out by: yongari
Reviewed by:    yongari, wma
Obtained from:  Semihalf
Sponsored by:   Cavium
Differential Revision: https://reviews.freebsd.org/D5537

8 years agoDon't manage free SQ entry index by the atomic operations
Zbigniew Bodek [Tue, 29 Mar 2016 13:28:13 +0000 (13:28 +0000)]
Don't manage free SQ entry index by the atomic operations

It is not necessary as entries are being manipulated under lock.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5536

8 years agoAdd some device IDs found on AMD FCH shipsets.
Alexander Motin [Tue, 29 Mar 2016 12:50:42 +0000 (12:50 +0000)]
Add some device IDs found on AMD FCH shipsets.

MFC after: 2 weeks

8 years agoAdd support for AMD FCH watchdog timers.
Alexander Motin [Tue, 29 Mar 2016 12:19:46 +0000 (12:19 +0000)]
Add support for AMD FCH watchdog timers.

MFC after: 2 weeks

8 years agoAdd phttpget(8) .Xr to fetch(1).
Edward Tomasz Napierala [Tue, 29 Mar 2016 11:56:00 +0000 (11:56 +0000)]
Add phttpget(8) .Xr to fetch(1).

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoVerify that all segments in the loaded segment list are back to back
Hans Petter Selasky [Tue, 29 Mar 2016 10:47:14 +0000 (10:47 +0000)]
Verify that all segments in the loaded segment list are back to back
with regard to the page offset, and not only the two first ones.

8 years agoCalibrate the frequency of the of the native_lapic_ipi_wait() loop,
Konstantin Belousov [Tue, 29 Mar 2016 08:44:56 +0000 (08:44 +0000)]
Calibrate the frequency of the of the native_lapic_ipi_wait() loop,
and avoid a delay while waiting for IPI delivery acknowledgement in
xAPIC mode.  This makes the loop exit immediately after the delivery
bit in APIC_ICR register is set, instead of waiting for some
microseconds.

We only need to ensure that some amount of time is allowed for the
LAPIC to react to the command, and we need that the wait time is
finite and reasonable.  For that reasons, it is irrelevant if the CPU
frequency or throttling decrease the speed and make the loop,
calibrated for full CPU speed at boot time, execute somewhat slower.

Discussed with: bde, jhb
Tested by: pho
Sponsored by: The FreeBSD Foundation

8 years agoUse ANSI function definition.
Konstantin Belousov [Tue, 29 Mar 2016 08:31:34 +0000 (08:31 +0000)]
Use ANSI function definition.

Sponsored by: The FreeBSD Foundation

8 years agoCAM: Generalize 4k quirk to all Samsung MZ7* SSDs
Jean-Sébastien Pédron [Tue, 29 Mar 2016 06:56:46 +0000 (06:56 +0000)]
CAM: Generalize 4k quirk to all Samsung MZ7* SSDs

This adds Samsung PM851 to the list. It can be found in Lenovo Thinkpad
T440 for instance.

Reviewed by: Kevin Bowling <kevin.bowling@kev009.com>,
Jason Wolfe <j@nitrology.com>
Approved by: Kevin Bowling <kevin.bowling@kev009.com>,
Jason Wolfe <j@nitrology.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5753

8 years agokrping wasn't designed to take more than one client. Fail any connect
Navdeep Parhar [Tue, 29 Mar 2016 01:41:07 +0000 (01:41 +0000)]
krping wasn't designed to take more than one client.  Fail any connect
requests if cb->state is not IDLE.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Reviewed by: Steve Wise @ Open Grid Computing
Sponsored by: Chelsio Communications

8 years agocxgbe/iw_cxgbe: Fix for stray "start_ep_timer timer already started!"
Navdeep Parhar [Tue, 29 Mar 2016 00:10:47 +0000 (00:10 +0000)]
cxgbe/iw_cxgbe: Fix for stray "start_ep_timer timer already started!"
messages.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

8 years agoMove the various per-type arrays of OSD data into a single structure array.
Jamie Gritton [Mon, 28 Mar 2016 22:18:37 +0000 (22:18 +0000)]
Move the various per-type arrays of OSD data into a single structure array.

8 years agoDon't start the random harvester process until timers are working.
John Baldwin [Mon, 28 Mar 2016 21:51:56 +0000 (21:51 +0000)]
Don't start the random harvester process until timers are working.

This is a no-op currently, but in kernels with earlier AP startup, the
random kthread was trying to use timeouts with sleeps before timers are
working.  Wait until SI_SUB_KICK_SCHEDULER to start the random kproc.

Reviewed by: delphij, imp, markm
Approved by: so
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D5712

8 years agoMove pccard_safe_quote() up to subr_bus.c and rename to
Warner Losh [Mon, 28 Mar 2016 20:16:29 +0000 (20:16 +0000)]
Move pccard_safe_quote() up to subr_bus.c and rename to
devctl_safe_quote() so it can be used more generally.

8 years agoFix two more unhappy instances of "user land".
Warren Block [Mon, 28 Mar 2016 19:55:30 +0000 (19:55 +0000)]
Fix two more unhappy instances of "user land".

Submitted by: bdrewery
MFC after: 1 week

8 years agosimplify compile-time default keyboard map generation
Ed Maste [Mon, 28 Mar 2016 19:51:45 +0000 (19:51 +0000)]
simplify compile-time default keyboard map generation

In r296926 the -P <path> option was added to kbdcontrol, which enables
this change for a simplified compile-time default keymap build process.

PR: 193865
Reviewed by: Oliver Pinter
Tested by: Oliver Pinter
MFC After: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5708

8 years agoDon't allow the user to set a peer primary which is restricted
Michael Tuexen [Mon, 28 Mar 2016 19:32:13 +0000 (19:32 +0000)]
Don't allow the user to set a peer primary which is restricted
and not pending.

MFC after: 1 week

8 years agoRestrict local addresses until they are acked by the peer.
Michael Tuexen [Mon, 28 Mar 2016 19:31:10 +0000 (19:31 +0000)]
Restrict local addresses until they are acked by the peer.

MFC after: 1 week

8 years agosh: Fix use-after-free if a trap replaces itself.
Jilles Tjoelker [Mon, 28 Mar 2016 18:58:40 +0000 (18:58 +0000)]
sh: Fix use-after-free if a trap replaces itself.

MFC after: 1 week

8 years agoFix parsing of a 1GB page table entry.
John Baldwin [Mon, 28 Mar 2016 18:41:48 +0000 (18:41 +0000)]
Fix parsing of a 1GB page table entry.

Use 'pdpe' to extract the PA of the 1GB page instead of 'pde' (which was
a copy and paste bug from the 2MB page case further down).

CID: 1341467
Reported by: pfg

8 years agoAdd ethertype reserved for network testing
George V. Neville-Neil [Mon, 28 Mar 2016 18:25:54 +0000 (18:25 +0000)]
Add ethertype reserved for network testing

MFC after: 2 weeks

8 years agoReplace "user land", which, for any definition of the word "user",
Warren Block [Mon, 28 Mar 2016 17:42:14 +0000 (17:42 +0000)]
Replace "user land", which, for any definition of the word "user",
sounds like some kind of horrific theme park.  "Hey kids, want to go to
User Land?"  "No!  We'll be good!"

The obvious replacement is "userland", a compound word replete with
term-of-art meaning and just a hint of cautionary tale.  The alternate
terms "flugelhorn" and "bullfrog", while also good, are less well-known
and were voted down in committee.

MFC after: 1 week

8 years agoSupport simple soft floating point abi for CPUTYPE in arm. Complex
Warner Losh [Mon, 28 Mar 2016 17:32:31 +0000 (17:32 +0000)]
Support simple soft floating point abi for CPUTYPE in arm. Complex
types to follow.

8 years agoFix bunch of .Xrs.
Edward Tomasz Napierala [Mon, 28 Mar 2016 16:48:28 +0000 (16:48 +0000)]
Fix bunch of .Xrs.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoDo not load LAPIC_DCR_TIMER with an undefined value. If we are in the
Konstantin Belousov [Mon, 28 Mar 2016 15:05:00 +0000 (15:05 +0000)]
Do not load LAPIC_DCR_TIMER with an undefined value.  If we are in the
deadline mode the divide configuration is not used and
lapic_timer_divisor is not set.

Reported by: dhw, mav
Tested by: mav
Sponsored by: The FreeBSD Foundation

8 years agoPass clkdev_if methods through to parent device by default.
Jared McNeill [Mon, 28 Mar 2016 11:51:35 +0000 (11:51 +0000)]
Pass clkdev_if methods through to parent device by default.

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

8 years agoTrigger sending of queued ASCONF chunks if outstanding ones are ACKED.
Michael Tuexen [Mon, 28 Mar 2016 11:32:20 +0000 (11:32 +0000)]
Trigger sending of queued ASCONF chunks if outstanding ones are ACKED.

MFC after: 1 week

8 years agoUse TSC deadline mode for LAPIC timer, when available. The mode fires
Konstantin Belousov [Mon, 28 Mar 2016 09:52:44 +0000 (09:52 +0000)]
Use TSC deadline mode for LAPIC timer, when available.  The mode fires
LAPIC timer iinterrupt when TSC reaches the value written to the
IA32_TSC_DEADLINE MSR.  To arm or reset the timer in deadline mode, a
single non-serializing MSR write is enough.  This is an advance from
the one-shot mode of LAPIC, where timer operated with the FSB
frequency and required two (serialized in case of xAPIC) writes to the
APIC registers.

The LVT_TIMER register value is cached to avoid unneeded writes in the
deadline mode.  Unused arguments to specify period (which is passed in
struct lapic as la_timer_period) and interrupt enable (which is always
enabled) are removed from lapic_timer_{oneshot,periodic,deadline}
functions.  Instead, special lapic_timer_oneshot_nointr() function for
interrupt-less one-shot calibration is added.

Reviewed by: mav (previous version)
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D5738

8 years agoAdd defines for the LAPIC TSC deadline timer mode. The LVT timer mode
Konstantin Belousov [Mon, 28 Mar 2016 09:43:40 +0000 (09:43 +0000)]
Add defines for the LAPIC TSC deadline timer mode.  The LVT timer mode
field is two-bit, extend the mask.

Also add comments about all MSRs writes to which are not serializing.

Sponsored by: The FreeBSD Foundation

8 years agoPass through error code from make_dev_p().
Alexander Motin [Mon, 28 Mar 2016 08:12:29 +0000 (08:12 +0000)]
Pass through error code from make_dev_p().

ENAMETOOLONG is much more informative in logs then ENXIO.

MFC after: 1 week