]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoRemove the old depend (mkdep) code and make FAST_DEPEND the one true way.
bdrewery [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.
bdrewery [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.
bdrewery [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.
bdrewery [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...
bdrewery [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.
bdrewery [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.
loos [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
loos [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 [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.
loos [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 [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.
mav [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.
mav [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
loos [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
emaste [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.
pfg [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.
hselasky [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 [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.
pfg [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.
pfg [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
np [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 [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 [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.
markj [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.
pfg [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,
kib [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
glebius [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.
kib [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:
kib [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.
markj [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".
mav [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.
loos [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.
bdrewery [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.
bdrewery [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
zbb [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.
trasz [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 [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
zbb [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
zbb [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.
mav [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.
mav [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).
trasz [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
hselasky [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,
kib [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.
kib [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
dumbbell [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
np [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!"
np [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 [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.
jhb [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
imp [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".
wblock [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
emaste [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
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.
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 [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.
jhb [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
gnn [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",
wblock [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
imp [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.
trasz [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
kib [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.
jmcneill [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.
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
kib [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
kib [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().
mav [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

8 years agoUpdate superblock and inode structs for ext4.
kevlo [Mon, 28 Mar 2016 07:44:55 +0000 (07:44 +0000)]
Update superblock and inode structs for ext4.

Reviewed by: pfg

8 years agovt: Use textmode when we're running on hypervisors
sephe [Mon, 28 Mar 2016 07:36:54 +0000 (07:36 +0000)]
vt: Use textmode when we're running on hypervisors

The graphic mode is noticeably slow on hypervisors, especially
on Hyper-V (1 second to each line).

Submitted by: Dexuan Cui <decui microsoft com>
Reviewed by: kib, sephe, royger (early loader version)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5739

8 years agoSometimes, it's useful to export the entire line to an external
imp [Mon, 28 Mar 2016 04:22:22 +0000 (04:22 +0000)]
Sometimes, it's useful to export the entire line to an external
program without listening to the devd socket for all events. Define
two new pseudo variables $*, the entire event from devctl and $_,
the entire event without the type character, since it might be easier
to use in some circumstances.

8 years agoAdjust misleading wording of the -G option and simplify a few
wblock [Mon, 28 Mar 2016 02:05:35 +0000 (02:05 +0000)]
Adjust misleading wording of the -G option and simplify a few
surrounding sentences.  From a discussion on -ports.

Reviewed by: David Wolfskill <david@catwhisker.org>

8 years agoUse correct response bits for MMC_RSP_R4-R7 types
kan [Sun, 27 Mar 2016 23:19:21 +0000 (23:19 +0000)]
Use correct response bits for MMC_RSP_R4-R7 types

8 years agoDo nothing if requested clk frequency is already correct.
kan [Sun, 27 Mar 2016 23:19:20 +0000 (23:19 +0000)]
Do nothing if requested clk frequency is already correct.

Reviewed by: mmel

8 years agoDo not override top level CFLAGS in libexec/dma
kan [Sun, 27 Mar 2016 23:19:14 +0000 (23:19 +0000)]
Do not override top level CFLAGS in libexec/dma

8 years agoDo not try to install a default route for each interface found, because
ian [Sun, 27 Mar 2016 23:16:37 +0000 (23:16 +0000)]
Do not try to install a default route for each interface found, because
only the first one will actually work and all the others just result in
errors (which would get printed but otherwise ignored).

Instead, wait until we make a choice of which interface will be used to
mount the rootfs, and install the default route associated with it (if any).
After doing the md_mount() call to obtain the needed info, remove the
default route again, and transcribe the route info into the nfs_diskless
structure.  If the system eventually chooses to mount the nfs rootfs, the
default route will be installed again when the nfs_diskless code
re-initializes the interface.

The theory here is that since we can only have one default route, the one
most likely to be correct for mounting the rootfs is the one that was
delivered along with the rootpath option.

8 years agoStop setting the default route to the IP of the interface itself when the
ian [Sun, 27 Mar 2016 22:58:56 +0000 (22:58 +0000)]
Stop setting the default route to the IP of the interface itself when the
bootp/dhcp server doesn't provide a router option.  Doing so prevents
setting defaultrouter=<ip> in rc.conf (it fails because there's already
a bogus default route installed by bootpc_init).

When an admin wants to use this style of proxy arp on an interface, the
proper mechanism is to set the "use-lease-addr-for-default-route" flag
in the dhcp server config.  That causes the lease address to be delivered
in the routers option, and the normal handling of the routers option will
then install the self-ip as the default route.

PR: 187094

8 years agoSwitch bootpc_adjust_interface() from returning int to void. Its one caller
ian [Sun, 27 Mar 2016 22:36:32 +0000 (22:36 +0000)]
Switch bootpc_adjust_interface() from returning int to void.  Its one caller
doesn't check for errors, and all the errors that can happen result in it
calling panic anyway, except for one that's really more of a warning (and
is going to disappear on an upcoming commit anyway).

8 years agoSet ifctx->gotrootpath=1 only when the root path came from the dhcp/bootp
ian [Sun, 27 Mar 2016 22:21:34 +0000 (22:21 +0000)]
Set ifctx->gotrootpath=1 only when the root path came from the dhcp/bootp
server (and not when it came from a fallback method such as the ROOTDEVNAME
option).  This makes the code in bootpc_init() choose the first interface
that provided a rootpath name.  Previously it was choosing the first
interface that got an IP address, which could be on a different and
potentially unreachable subnet than the server providing the rootfs.

If the rootpath name actually does come from a fallback source, then the
code continues to use the first interface in the list that got configured.

Note that this wasn't directly reported in the PR cited below, but was
discovered while working on that PR.

PR: 187094

8 years agoPull in r255683 from upstream libc++ trunk (by Eric Fiselier):
dim [Sun, 27 Mar 2016 21:20:43 +0000 (21:20 +0000)]
Pull in r255683 from upstream libc++ trunk (by Eric Fiselier):

  [libcxx] Enable noexcept for GCC 4.6 and greater

  Summary:
  This patch allows GCC 4.6 and above to use `noexcept` as opposed to
  `throw()`.

  Is it an ABI safe change to suddenly switch on `noexcept`? I imagine
  it must be because it's disabled in w/ clang in C++03 but not C++11.

  Reviewers: danalbert, jroelofs, mclow.lists

  Subscribers: cfe-commits

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

This should fix errors from gcc 4.6 and higher when compiling llvm-cov
and/or other llvm tools.

Reported by: bdrewery

8 years agonetstat: avoid returning uninitialized value in p_sockaddr().
pfg [Sun, 27 Mar 2016 20:02:21 +0000 (20:02 +0000)]
netstat: avoid returning uninitialized value in p_sockaddr().

In the case the width is less than 0, we are returning an uninitialized
value. For practical purposes the return value is ignored but initialize
it to avoid trouble.

CID: 1341619

8 years agopf: Friendly error message for status if pf.ko is not loaded
kp [Sun, 27 Mar 2016 17:22:27 +0000 (17:22 +0000)]
pf: Friendly error message for status if pf.ko is not loaded

Check if pf.ko is loaded (i.e. /dev/pf exists) before trying to use it. This
means that '/etc/rc.d/pf status' will no longer return 'pfctl: /dev/pf: No such
file or directory' but 'pf.ko is not loaded'.

PR: 205671
Submitted by: Johannes Jost Meixner <xmj@FreeBSD.org>

8 years agorc.d: Make msgs a proper rc.d script.
jilles [Sun, 27 Mar 2016 16:27:49 +0000 (16:27 +0000)]
rc.d: Make msgs a proper rc.d script.

PR: 207149
Reported by: Jonathan de Boyne Pollard

8 years agoRevert r297310 as the SOL_XXX are equal to the IPPROTO_XX except SOL_SOCKET.
dchagin [Sun, 27 Mar 2016 10:09:10 +0000 (10:09 +0000)]
Revert r297310 as the SOL_XXX are equal to the IPPROTO_XX except SOL_SOCKET.

Pointed out by: ae@

8 years agoImprove compilation on windows 64-bit (for the userland stack).
tuexen [Sun, 27 Mar 2016 10:04:25 +0000 (10:04 +0000)]
Improve compilation on windows 64-bit (for the userland stack).

MFC after: 1 week

8 years agoSplit the global taskqueue used to process all UFS trim completions,
kib [Sun, 27 Mar 2016 08:21:17 +0000 (08:21 +0000)]
Split the global taskqueue used to process all UFS trim completions,
into per-mount taskqueue with the private taskqueue processing thread.
This allows to drain the taskqueue on unmount, to ensure that all
TRIMs are finished before mount structures are freed.

But just draining the taskqueue where TRIM biodone geom-up completions
are processed is not enough, since ffs_blkfree(), called by the task,
might result in more writes.  Count inflight delayed blkfree's and
pause() unmount until the counter drains as well.

Reported by: Nick Evans <nevans@talkpoint.com>
Tested by: Nick Evans <nevans@talkpoint.com>, pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoiConvert Linux SOL_IPV6 level.
dchagin [Sun, 27 Mar 2016 08:12:01 +0000 (08:12 +0000)]
iConvert Linux SOL_IPV6 level.

MFC after: 1 week

8 years agoWhitespaces and style(9) fix. No functional changes.
dchagin [Sun, 27 Mar 2016 08:10:20 +0000 (08:10 +0000)]
Whitespaces and style(9) fix. No functional changes.

MFC after: 1 week

8 years agoStyle: wrap long lines.
kib [Sun, 27 Mar 2016 08:07:12 +0000 (08:07 +0000)]
Style: wrap long lines.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoCompile libcxxrt as C++11, since it is only really used in combination
dim [Sun, 27 Mar 2016 00:37:54 +0000 (00:37 +0000)]
Compile libcxxrt as C++11, since it is only really used in combination
with libc++, which is also C++11.  Also change one _Static_assert (which
is really C11) back into static_assert, like upstream.

This should help when compiling libcxxrt with newer versions of gcc,
which refuse to recognize any form of static assertions, if not
compiling for C++11 or higher.

While here, add -nostdinc++ to CFLAGS, to prevent picking up any C++
headers outside the source tree.

8 years agoPlug leak in m_unshare.
np [Sat, 26 Mar 2016 23:39:53 +0000 (23:39 +0000)]
Plug leak in m_unshare.

m_unshare passes on the source mbuf's flags as-is to m_getcl and this
results in a leak if the flags include M_NOFREE.  The fix is to clear
the bits not listed in M_COPYALL before calling m_getcl.  M_RDONLY
should probably be filtered out too but that's outside the scope of this
fix.

Add assertions in the zone_mbuf and zone_pack ctors to catch similar
bugs.

Update netmap_get_mbuf to not pass M_NOFREE to m_getcl.  It's not clear
what the original code was trying to do but it's likely incorrect.
Updated code is no different functionally but it avoids the newly added
assertions.

Reviewed by: gnn@
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D5698

8 years agoWhen write(2) on eventfd object fails with the error EAGAIN do not return
dchagin [Sat, 26 Mar 2016 19:16:53 +0000 (19:16 +0000)]
When write(2) on eventfd object fails with the error EAGAIN do not return
the number of bytes written.

MFC after: 1 week

8 years agoImplement O_NONBLOCK flag via fcntl(F_SETFL) for eventfd object.
dchagin [Sat, 26 Mar 2016 19:15:23 +0000 (19:15 +0000)]
Implement O_NONBLOCK flag via fcntl(F_SETFL) for eventfd object.

MFC after: 1 week

8 years agoOnly define the platform methods for the Allwinner platforms we are
andrew [Sat, 26 Mar 2016 17:49:46 +0000 (17:49 +0000)]
Only define the platform methods for the Allwinner platforms we are
building for.

Sponsored by: ABT Systems Ltd

8 years agoPull in r264465 from upstream llvm trunk (by David Majnemer):
dim [Sat, 26 Mar 2016 17:38:15 +0000 (17:38 +0000)]
Pull in r264465 from upstream llvm trunk (by David Majnemer):

  [X86] Emit a proper ADJCALLSTACKDOWN in EmitLoweredTLSAddr

  We forgot to add the second machine operand to our ADJCALLSTACKDOWN,
  resulting in crashes in PEI.

  This fixes PR27071.

This should fix an assertion failure during buildworld, when using -Os,
and targeting either i386 directly, or building the 32-bit libraries on
amd64.

Reported by: Eric Camachat <eric.camachat@gmail.com>

8 years agoDo not prompt for GELI passphrase is encrypted with keys only
allanjude [Sat, 26 Mar 2016 15:39:48 +0000 (15:39 +0000)]
Do not prompt for GELI passphrase is encrypted with keys only

PR: 208251
Submitted by: Fabian Keil <fk@fabiankeil.de>
Sponsored by: ScaleEngine Inc.

8 years agoARM: Fix bug introduced in r297286.
mmel [Sat, 26 Mar 2016 12:19:27 +0000 (12:19 +0000)]
ARM: Fix bug introduced in r297286.
 - don't put command line without guard to kernel environment.
 - kernel environment delivered from ubldr must have absolute precedence.

8 years agoCleanup headers
bapt [Sat, 26 Mar 2016 12:11:46 +0000 (12:11 +0000)]
Cleanup headers

Found by: include-what-you-use

8 years agoRemove some unneeded headers
bapt [Sat, 26 Mar 2016 11:41:35 +0000 (11:41 +0000)]
Remove some unneeded headers

Found by 'include-what-you-use'

8 years agoUpdate pci_vendors database to 2016-02-27
bapt [Sat, 26 Mar 2016 11:13:17 +0000 (11:13 +0000)]
Update pci_vendors database to 2016-02-27

MFC after: 1 week

8 years agoTEGRA: Fixes for UART driver:
mmel [Sat, 26 Mar 2016 10:09:28 +0000 (10:09 +0000)]
TEGRA: Fixes for UART driver:
 - add mising 'or' in tegra_uart_attach()
   Pointed by: kan
 - fix indentation of tegra_softc
 - remove forgoten debug printf