]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoDon't create pointless backups of generated files in "make sysent".
brooks [Thu, 28 Jul 2016 21:29:04 +0000 (21:29 +0000)]
Don't create pointless backups of generated files in "make sysent".

Any sensible workflow will include a revision control system from which
to restore the old files if required.  In normal usage, developers just
have to clean up the mess.

Reviewed by: jhb
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D7353

7 years agocxgbe's firmware module fails to build on mips64 as well as mips32 so
brooks [Thu, 28 Jul 2016 21:27:47 +0000 (21:27 +0000)]
cxgbe's firmware module fails to build on mips64 as well as mips32 so
disable for all mips.

Sponsored by: DARPA, AFRL

7 years agoNote that not all optional ptrace events use SIGTRAP.
jhb [Thu, 28 Jul 2016 20:51:29 +0000 (20:51 +0000)]
Note that not all optional ptrace events use SIGTRAP.

New child processes attached due to PTRACE_FORK use SIGSTOP instead of
SIGTRAP.  All other ptrace events use SIGTRAP.

7 years agoCall tcp_notify() directly to shoot down routes, rather than
gallatin [Thu, 28 Jul 2016 19:32:25 +0000 (19:32 +0000)]
Call tcp_notify() directly to shoot down routes, rather than
calling in_pcbnotifyall().

This avoids lock contention on tcbinfo due to in_pcbnotifyall()
holding the tcbinfo write lock while walking all connections.

Reviewed by: rrs, karels
MFC after: 2 weeks
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D7251

7 years agoAdd tblgen to ObsoleteFiles.inc, as it was renamed to llvm-tblgen.
dim [Thu, 28 Jul 2016 18:40:43 +0000 (18:40 +0000)]
Add tblgen to ObsoleteFiles.inc, as it was renamed to llvm-tblgen.

Noticed by: pluknet
MFC after: 3 days

7 years agoRemove BSD and USL copyright and update license block in in_prot.c, as the
stevek [Thu, 28 Jul 2016 18:39:30 +0000 (18:39 +0000)]
Remove BSD and USL copyright and update license block in in_prot.c, as the
code in this file was written by Robert N. M. Waston.

Move cr_can* prototypes from sys/systm.h to sys/proc.h

Reported by: rwatson
Reviewed by: rwatson
Approved by: sjg (mentor)
Differential Revision: https://reviews.freebsd.org/D7345

7 years agoMark spg_len and fl_pktshift static.
jhb [Thu, 28 Jul 2016 17:37:12 +0000 (17:37 +0000)]
Mark spg_len and fl_pktshift static.

These variables are no longer exported to t4_netmap.c after r296478.

7 years agoNormalise the CWARNFLAGS inter-word spacing: remove all leading
br [Thu, 28 Jul 2016 17:18:02 +0000 (17:18 +0000)]
Normalise the CWARNFLAGS inter-word spacing: remove all leading
and trailing space, and convert multiple consecutive spaces to
single space.

This helps to keep build output looking good.

7 years agoindent: avoid calling write(2) with a negative second parameter.
pfg [Thu, 28 Jul 2016 16:54:12 +0000 (16:54 +0000)]
indent: avoid calling write(2) with a negative second parameter.

negative_returns: n is passed to a parameter that cannot be negative.
Fix a style issue while here.

CID: 1008107

7 years agoFix up prototypes of basename(3) and dirname(3) to comply to POSIX.
ed [Thu, 28 Jul 2016 16:20:27 +0000 (16:20 +0000)]
Fix up prototypes of basename(3) and dirname(3) to comply to POSIX.

POSIX allows these functions to be implemented in a way that the
resulting string is stored in the input buffer. Though some may find
this annoying, this has the advantage that it makes it possible to
implement this function in a thread-safe way. It also means that they
can be implemented in a way that they work for paths of arbitrary
length, as the output string of these functions is never longer than
max(1, len(input)).

Portable code already needs to be written with this in mind, so in my
opinion it makes very little sense to allow the existing behaviour.
Prevent the base system from falling back to this by switching over to
POSIX prototypes.

I'm not going to bump the __FreeBSD_version for this. The reason is that
it's possible to account for this change in a portable way, without
depending on a specific version of FreeBSD. An exp-run was done some
time ago. As far as I know, all regressions as a result of this have
already been fixed.

I'll give this change some time to settle. In the long run I want to
replace our copies by ones that are thread-safe and don't depend on
PATH_MAX/MAXPATHLEN.

7 years agoPull a copy of the input string before calling basename() and dirname().
ed [Thu, 28 Jul 2016 16:06:37 +0000 (16:06 +0000)]
Pull a copy of the input string before calling basename() and dirname().

POSIX allows implementations of these functions to modify their input.

7 years agoClean up use of basename() and dirname().
ed [Thu, 28 Jul 2016 16:02:30 +0000 (16:02 +0000)]
Clean up use of basename() and dirname().

Pull copies of the input pathname string before calling basename() and
dirname() to make this comply to POSIX. Free these copies at the end of
this function. While there, remove the duplication of the 's' ->
'logfname' string. There is no need for this.

7 years agoDo not delegate a work to geom event thread which can be done inline.
kib [Thu, 28 Jul 2016 15:57:01 +0000 (15:57 +0000)]
Do not delegate a work to geom event thread which can be done inline.

In particular, swapongeom_ev() needed event thread context when swap
pager configuration was performed under Giant and geom asserted that
Giant is not owned.  Now both of the reason went away.

On the other hand, note that swpageom_release() is called from the
bio_done context, and possible close cannot be performed inline.

Also fix some minor issues.  The swapgeom() function does not use the
td argument, remove it.  Recheck that the vnode passed is still VCHR
and not reclaimed after the lock.

Reviewed by: mav
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoFix style and typo.
kib [Thu, 28 Jul 2016 15:49:51 +0000 (15:49 +0000)]
Fix style and typo.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoCall basename() and dirname() in the POSIXly correct way.
ed [Thu, 28 Jul 2016 15:33:19 +0000 (15:33 +0000)]
Call basename() and dirname() in the POSIXly correct way.

Pull copies of the input string, as these functions are allowed to
modify them. Free the copies after creating the new pathname string.

7 years agoCall basename() in a portable way.
ed [Thu, 28 Jul 2016 15:19:47 +0000 (15:19 +0000)]
Call basename() in a portable way.

Pull a copy of the filename string before calling basename(). Change the
loop to not return on its own, so we can put a free() statement at the
bottom.

7 years agoDon't call basename() and dirname() in an unportable way.
ed [Thu, 28 Jul 2016 15:17:12 +0000 (15:17 +0000)]
Don't call basename() and dirname() in an unportable way.

POSIX allows these functions to modify their input buffer, so that they
have storage for the return value. Pull copies of the filename before
calling these utility functions.

7 years agoremove CONSTRUCTORS from kernel linker scripts
emaste [Thu, 28 Jul 2016 13:54:46 +0000 (13:54 +0000)]
remove CONSTRUCTORS from kernel linker scripts

The linker script CONSTRUCTORS keyword is only meaningful "when linking
object file formats which do not support arbitrary sections, such as
ECOFF and XCOFF"[1] and is ignored for other object file formats.

LLVM's lld does not yet accept (and ignore) CONSTRUCTORS, so just remove
CONSTRUCTORS from the linker scripts as it has no effect.

[1] https://sourceware.org/binutils/docs/ld/Output-Section-Keywords.html

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7343

7 years agoRegenerate src.conf.5 after r303394
emaste [Thu, 28 Jul 2016 13:35:46 +0000 (13:35 +0000)]
Regenerate src.conf.5 after r303394

7 years agoBuild ofw_bus_if.h for modules for RISC-V.
br [Thu, 28 Jul 2016 13:21:45 +0000 (13:21 +0000)]
Build ofw_bus_if.h for modules for RISC-V.

7 years agoBuild DTrace assym.o with -msoft-float flag for RISC-V so we have
br [Thu, 28 Jul 2016 13:18:10 +0000 (13:18 +0000)]
Build DTrace assym.o with -msoft-float flag for RISC-V so we have
correct flag in ELF file.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoo Add warn flags required to build modules with GCC 6.1;
br [Thu, 28 Jul 2016 13:15:23 +0000 (13:15 +0000)]
o Add warn flags required to build modules with GCC 6.1;
o Sort GCC 4.8 warn flags.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoFix r303429 build with invariants.
mav [Thu, 28 Jul 2016 12:25:58 +0000 (12:25 +0000)]
Fix r303429 build with invariants.

7 years agoRegenerate system call table for r303435.
ed [Thu, 28 Jul 2016 12:22:34 +0000 (12:22 +0000)]
Regenerate system call table for r303435.

7 years agoChange the return type of msgrcv() to ssize_t as required by POSIX.
ed [Thu, 28 Jul 2016 12:22:01 +0000 (12:22 +0000)]
Change the return type of msgrcv() to ssize_t as required by POSIX.

It looks like the msgrcv() system call is already written in such a way
that the size is internally computed as a size_t and written into all of
td_retval[0]. This means that it is effectively already returning
ssize_t. It's just that the userspace prototype doesn't match up.

7 years agoOnce more refactor KPI between NTB hardware and consumers.
mav [Thu, 28 Jul 2016 10:48:20 +0000 (10:48 +0000)]
Once more refactor KPI between NTB hardware and consumers.

New design allows hardware resources to be split between several consumers.
For example, one BAR can be dedicated for remote memory access, while other
resources can be used for packet transport for virtual Ethernet interface.
And even without resource split, this code allows to specify which consumer
driver should attach the hardware.

From some points this makes the code even closer to Linux one, even though
Linux does not provide the described flexibility.

7 years agoAdd NI_NUMERICSCOPE.
ed [Thu, 28 Jul 2016 10:05:41 +0000 (10:05 +0000)]
Add NI_NUMERICSCOPE.

POSIX also declares NI_NUMERICSCOPE, which makes getnameinfo() return a
numerical scope identifier. The interesting thing is that support for
this is already present in code, but #ifdef disabled. Expose this
functionality by placing a definition for it in <netdb.h>.

While there, remove references to NI_WITHSCOPEID, as that got removed 11
years ago.

7 years agoChange type of MB_CUR_MAX and MB_CUR_MAX_L() to size_t.
ed [Thu, 28 Jul 2016 09:50:19 +0000 (09:50 +0000)]
Change type of MB_CUR_MAX and MB_CUR_MAX_L() to size_t.

POSIX requires that MB_CUR_MAX expands to an expression of type size_t.
It currently expands to an int. As these are already macros, don't
change the underlying type of these functions. There is no ned to touch
those.

Differential Revision: https://reviews.freebsd.org/D6645

7 years agoRewrite subr_sleepqueue.c use of callouts to not depend on the
kib [Thu, 28 Jul 2016 09:09:55 +0000 (09:09 +0000)]
Rewrite subr_sleepqueue.c use of callouts to not depend on the
specifics of callout KPI.  Esp., do not depend on the exact interface
of callout_stop(9) return values.

The main change is that instead of requiring precise callouts, code
maintains absolute time to wake up.  Callouts now should ensure that a
wake occurs at the requested moment, but we can tolerate both run-away
callout, and callout_stop(9) lying about running callout either way.

As consequence, it removes the constant source of the bugs where
sleepq_check_timeout() causes uninterruptible thread state where the
thread is detached from CPU, see e.g. r234952 and r296320.

Patch also removes dual meaning of the TDF_TIMEOUT flag, making code
(IMO much) simpler to reason about.

Tested by: pho
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D7137

7 years agoExtract the calculation of the callout fire time into the new function
kib [Thu, 28 Jul 2016 08:57:01 +0000 (08:57 +0000)]
Extract the calculation of the callout fire time into the new function
callout_when(9).  See the man page update for the description of the
intended use.

Tested by: pho
Reviewed by: jhb, bjk (man page updates)
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7137

7 years agoFix typo in comment.
kib [Thu, 28 Jul 2016 08:53:38 +0000 (08:53 +0000)]
Fix typo in comment.

MFC after:  3 days

7 years agoWhen a debugger attaches to the process, SIGSTOP is sent to the
kib [Thu, 28 Jul 2016 08:41:13 +0000 (08:41 +0000)]
When a debugger attaches to the process, SIGSTOP is sent to the
target.  Due to a way issignal() selects the next signal to deliver
and report, if the simultaneous or already pending another signal
exists, that signal might be reported by the next waitpid(2) call.
This causes minor annoyance for debuggers, which must be prepared to
take any signal as the first event, then filter SIGSTOP later.

More importantly, for tools like gcore(1), which attach and then
detach without processing events, SIGSTOP might leak to be delivered
after PT_DETACH.  This results in the process being unintentionally
stopped after detach, which is fatal for automatic tools.

The solution is to force SIGSTOP to be the first signal reported after
the attach.  Attach code is modified to set P2_PTRACE_FSTP to indicate
that the attaching ritual was not yet finished, and issignal() prefers
SIGSTOP in that condition.  Also, the thread which handles
P2_PTRACE_FSTP is made to guarantee to own p_xthread during the first
waitpid(2).  All that ensures that SIGSTOP is consumed first.

Additionally, if P2_PTRACE_FSTP is still set on detach, which means
that waitpid(2) was not called at all, SIGSTOP is removed from the
queue, ensuring that the process is resumed on detach.

In issignal(), when acting on STOPing signals, remove the signal from
queue before suspending.  Otherwise parallel attach could result in
ptracestop() acting on that STOP as if it was the STOP signal from the
attach.  Then SIGSTOP from attach leaks again.

As a minor refactoring, some bits of the common attach code is moved
to new helper proc_set_traced().

Reported by: markj
Reviewed by: jhb, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D7256

7 years agohyperv/vmbus: Inclusion cleanup
sephe [Thu, 28 Jul 2016 06:46:10 +0000 (06:46 +0000)]
hyperv/vmbus: Inclusion cleanup

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

7 years agohyperv/vmbus: Avoid unnecessary mb()
sephe [Thu, 28 Jul 2016 06:30:29 +0000 (06:30 +0000)]
hyperv/vmbus: Avoid unnecessary mb()

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

7 years agoEnable the build of micphy as part of generic miibus build, but only for
loos [Thu, 28 Jul 2016 05:59:56 +0000 (05:59 +0000)]
Enable the build of micphy as part of generic miibus build, but only for
FDT enabled systems.

Sponsored by: Rubicon Communications (Netgate)

7 years agoFix non-amd64 build from r292043 after reconnecting in r303410.
bdrewery [Wed, 27 Jul 2016 21:45:11 +0000 (21:45 +0000)]
Fix non-amd64 build from r292043 after reconnecting in r303410.

MFC after: 3 days
X-MFC-With: r303410
Sponsored by: EMC / Isilon Storage Division

7 years ago[iwm] When stopping TX DMA, wait for all channels at once.
ivadasz [Wed, 27 Jul 2016 20:51:31 +0000 (20:51 +0000)]
[iwm] When stopping TX DMA, wait for all channels at once.

    * Makes the TX DMA stopping more similar to Linux code, and potentially
      a bit faster. Also, output an error message when TX DMA idling fails.

    Taken-From: Linux iwlwifi

Tested:

* AC3165, STA mode

Approved by: adrian (mentor)
Obtained from: DragonFlyBSD git 2ee486ddff973ac552ff787c17e8d83e8ae0f24c
Differential Revision: https://reviews.freebsd.org/D7325

7 years agoopt_bdg.h was removed in r150636.
bdrewery [Wed, 27 Jul 2016 20:48:15 +0000 (20:48 +0000)]
opt_bdg.h was removed in r150636.

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

7 years ago[iwm] Set different pm_timeout for action frames.
ivadasz [Wed, 27 Jul 2016 20:46:51 +0000 (20:46 +0000)]
[iwm] Set different pm_timeout for action frames.

    When building a Tx Command for management frames, we are lacking
    a check for action frames, for which we should set a different
    pm_timeout.  This cause the fw to stay awake for 100TU after each
    such frame is transmitted, resulting an excessive power consumption.

    Taken-From: Linux iwlwifi (git b084a35663c3f1f7)

Approved by: adrian (mentor)
Obtained from: Linux git b084a35663c3f1f7de1c45c4ae3006864c940fe7
Obtained from: DragonFlyBSD git ba00f0e3ae873d6f0d5743e22c3ebc49c44dfdac
Differential Revision: https://reviews.freebsd.org/D7324

7 years agoopt_apic.h is only used on i386.
bdrewery [Wed, 27 Jul 2016 20:45:00 +0000 (20:45 +0000)]
opt_apic.h is only used on i386.

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

7 years agoopt_random.h was removed in r287558 for opt_global.h
bdrewery [Wed, 27 Jul 2016 20:44:53 +0000 (20:44 +0000)]
opt_random.h was removed in r287558 for opt_global.h

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

7 years ago[iwm] Fix inverted logic in iwm_tx().
ivadasz [Wed, 27 Jul 2016 20:43:08 +0000 (20:43 +0000)]
[iwm] Fix inverted logic in iwm_tx().

    The PROT_REQUIRE flag in should be set for data frames above a certain
    length, but we were setting it for !data frames above a certain length,
    which makes no sense at all.

    Taken-From: OpenBSD, Linux iwlwifi

Approved by: adrian (mentor)
Obtained from: DragonFlyBSD git 8cc03924a36c572c2908e659e624f44636dc2b33
Differential Revision: https://reviews.freebsd.org/D7323

7 years agoRemove myself from kern_timeout.c yeah!
rrs [Wed, 27 Jul 2016 20:37:32 +0000 (20:37 +0000)]
Remove myself from kern_timeout.c yeah!

7 years agoPrepare for network stack as a module
stevek [Wed, 27 Jul 2016 20:34:09 +0000 (20:34 +0000)]
Prepare for network stack as a module

 - Move cr_canseeinpcb to sys/netinet/in_prot.c in order to separate the
   INET and INET6-specific code from the rest of the prot code (It is only
   used by the network stack, so it makes sense for it to live with the
   other network stack code.)
 - Move cr_canseeinpcb prototype from sys/systm.h to netinet/in_systm.h
 - Rename cr_seeotheruids to cr_canseeotheruids and cr_seeothergids to
   cr_canseeothergids, make them non-static, and add prototypes (so they
   can be seen/called by in_prot.c functions.)
 - Remove sw_csum variable from ip6_forward in ip6_forward.c, as it is an
   unused variable.

Reviewed by: gnn, jtl
Approved by: sjg (mentor)
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D2901

7 years agoReconnect pmcstudy, lost in r291021
bdrewery [Wed, 27 Jul 2016 20:28:28 +0000 (20:28 +0000)]
Reconnect pmcstudy, lost in r291021

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

7 years agoAdjust tests in fsync job scheduling loop to reduce indentation.
jhb [Wed, 27 Jul 2016 19:31:25 +0000 (19:31 +0000)]
Adjust tests in fsync job scheduling loop to reduce indentation.

7 years agoAdd support for zero-copy aio_write() on TOE sockets.
jhb [Wed, 27 Jul 2016 18:29:35 +0000 (18:29 +0000)]
Add support for zero-copy aio_write() on TOE sockets.

AIO write requests for a TOE socket on a Chelsio T4+ adapter can now
DMA directly from the user-supplied buffer.  This is implemented by
wiring the pages backing the user-supplied buffer and queueing special
mbufs backed by raw VM pages to the socket buffer.  The TOE code
recognizes these special mbufs and builds a sglist from the VM page
array associated with the mbuf when queueing a work request to the TOE.

Because these mbufs do not have an associated virtual address, m_data
is not valid.  Thus, the AIO handler does not invoke sosend() directly
for these mbufs but instead inlines portions of sosend_generic() and
tcp_usr_send().

An aiotx_buffer structure is used to describe the user buffer (e.g.
it holds the array of VM pages and a reference to the AIO job).  The
special mbufs reference this structure via m_ext.  Note that a single
job might be split across multiple mbufs (e.g. if it is larger than
the socket buffer size).  The 'ext_arg2' member of each mbuf gives an
offset relative to the backing aiotx_buffer.  The AIO job associated
with an aiotx_buffer structure is completed when the last reference to
the structure is released.

Zero-copy aio_write()'s for connections associated with a given
adapter can be enabled/disabled at runtime via the
'dev.t[45]nex.N.toe.tx_zcopy' sysctl.

MFC after: 1 month
Relnotes: yes
Sponsored by: Chelsio Communications

7 years agoAdd a hack to add weekday to date format for ko_KR locale.
jkim [Wed, 27 Jul 2016 18:12:36 +0000 (18:12 +0000)]
Add a hack to add weekday to date format for ko_KR locale.

7 years agolibcxxrt: fix demangling of wchar_t
emaste [Wed, 27 Jul 2016 17:18:08 +0000 (17:18 +0000)]
libcxxrt: fix demangling of wchar_t

'wchar_t' is 7 characters long, not 6. r303297 fixed this in libelftc,
but not the second copy of this file that we have in libcxxrt.

PR: 208661
Submitted by: Daniel McRobb
Obtained from: ELF Tool Chain r3480
MFC after: 3 days

7 years agoDe-pluralize "queues" where appropriate in the pagedaemon code.
markj [Wed, 27 Jul 2016 17:11:03 +0000 (17:11 +0000)]
De-pluralize "queues" where appropriate in the pagedaemon code.

MFC after: 1 week

7 years agorename ARM's libunwind.S to to avoid conflict with llvm libunwind
emaste [Wed, 27 Jul 2016 16:34:19 +0000 (16:34 +0000)]
rename ARM's libunwind.S to to avoid conflict with llvm libunwind

llvm libunwind includes a libunwind.cpp, but on ARM libunwind.S is found
first in .PATH. Rename the latter one, since it is not going to be
updated again.

Reviewed by: andrew
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7162

7 years agoEnable LLVM libunwind by default on amd64 and i386
emaste [Wed, 27 Jul 2016 16:01:44 +0000 (16:01 +0000)]
Enable LLVM libunwind by default on amd64 and i386

It is a maintained and updated runtime exception stack unwinder that
should be a drop-in replacement.

It can be disabled by setting WITHOUT_LLVM_LIBUNWIND in src.conf.

PR: 206039 [exp-run]
Sponsored by: The FreeBSD Foundation

7 years agoRemove empty initializer for the once facility. It was not needed
kib [Wed, 27 Jul 2016 15:14:11 +0000 (15:14 +0000)]
Remove empty initializer for the once facility.  It was not needed
since r179417.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove ${OBJDUMP} as it is not used by the base system
emaste [Wed, 27 Jul 2016 14:58:15 +0000 (14:58 +0000)]
Remove ${OBJDUMP} as it is not used by the base system

It was added to sys.mk relatively recently (r274503) for EFI builds
but is no longer used by the base system. The in-tree binutils are
outdated, will not be updated, and will be removed in the future.
Remove it from the toolchain build now to slightly simplify the build
and make sure we don't grow an accidental dependency.

Note that this affects only the toolchain build, and does not affect
/usr/bin/objdump in the built world.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6460

7 years agoANSIfy kern_proc.c and delete register keyword
emaste [Wed, 27 Jul 2016 14:27:08 +0000 (14:27 +0000)]
ANSIfy kern_proc.c and delete register keyword

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6478

7 years agosyscons,vt: improve phrasing in kern.vty man page description
emaste [Wed, 27 Jul 2016 14:12:04 +0000 (14:12 +0000)]
syscons,vt: improve phrasing in kern.vty man page description

Submitted by: wblock

7 years agoRemove Giant from settime(), tc_setclock_mtx guards tc_windup() calls,
kib [Wed, 27 Jul 2016 11:54:24 +0000 (11:54 +0000)]
Remove Giant from settime(), tc_setclock_mtx guards tc_windup() calls,
and there is no other issues with parallel settime().  Remove spl()
vestiges there as well.

Tested by: pho (as part of the whole patch)
Reviewed by: jhb (same)
Discussed wit: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D7302

7 years agoPrevent parallel tc_windup() calls, both parallel top-level calls from
kib [Wed, 27 Jul 2016 11:49:41 +0000 (11:49 +0000)]
Prevent parallel tc_windup() calls, both parallel top-level calls from
setclock() and from simultaneous top-level and interrupt.  For this,
tc_windup() is protected with a tc_setclock_mtx spinlock, in the try
mode when called from hardclock interrupt.  If spinlock cannot be
obtained without spinning from the interrupt context, this means that
top-level executes tc_windup() on other core and our try may be
avoided.

The boottimebin and boottime variables should be adjusted from
tc_windup().  To be correct, they must be part of the timehands and
read using lockless protocol.  Remove the globals and reimplement the
getboottime(9)/getboottimebin(9) KPI using the timehands read
protocol.

Tested by: pho (as part of the whole patch)
Reviewed by: jhb (same)
Discussed wit: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302

7 years agoFix a bug in r302252.
kib [Wed, 27 Jul 2016 11:40:06 +0000 (11:40 +0000)]
Fix a bug in r302252.

Change ntpadj_lock to spinlock always, and rename stuff removing
ADJ/adj from the names. ntp_update_second() requires ntp_lock and is
called from the tc_windup(), so ntp_lock must be a spinlock.  Add
missed lock to ntp_update_second().

Tested by: pho (as part of the whole patch)
Reviewed by: jhb (same)
Noted by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302

7 years agoReduce the resettodr_lock scope to only CLOCK_SETTIME() call.
kib [Wed, 27 Jul 2016 11:34:25 +0000 (11:34 +0000)]
Reduce the resettodr_lock scope to only CLOCK_SETTIME() call.

Tested by: pho (as part of the whole patch)
Reviewed by: jhb (same)
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302

7 years agoStyle.
kib [Wed, 27 Jul 2016 11:33:33 +0000 (11:33 +0000)]
Style.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302

7 years agoReduce number of timehands to just two. This is useful because
kib [Wed, 27 Jul 2016 11:27:52 +0000 (11:27 +0000)]
Reduce number of timehands to just two.  This is useful because
consumers can now be only one tc_windup() call late.

Use C99 initialization.

Tested by: pho (as part of the whole patch)
Reviewed by: jhb (same)
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302

7 years agoHide the boottime and bootimebin globals, provide the getboottime(9)
kib [Wed, 27 Jul 2016 11:08:59 +0000 (11:08 +0000)]
Hide the boottime and bootimebin globals, provide the getboottime(9)
and getboottimebin(9) KPI. Change consumers of boottime to use the
KPI.  The variables were renamed to avoid shadowing issues with local
variables of the same name.

Issue is that boottime* should be adjusted from tc_windup(), which
requires them to be members of the timehands structure.  As a
preparation, this commit only introduces the interface.

Some uses of boottime were found doubtful, e.g. NLM uses boottime to
identify the system boot instance.  Arguably the identity should not
change on the leap second adjustment, but the commit is about the
timekeeping code and the consumers were kept bug-to-bug compatible.

Tested by: pho (as part of the bigger patch)
Reviewed by: jhb (same)
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302

7 years agohyperv/vmbus: Rename cleaned up bufring code
sephe [Wed, 27 Jul 2016 09:27:08 +0000 (09:27 +0000)]
hyperv/vmbus: Rename cleaned up bufring code

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

7 years agoDue to dropped mbuf in netisr queue route(8) can fall into infinity
ae [Wed, 27 Jul 2016 08:26:34 +0000 (08:26 +0000)]
Due to dropped mbuf in netisr queue route(8) can fall into infinity
loop of reading the rtsock's feed. When it used by some scripts,
this leads to growing number of not finished route(8) instances and
thus growing number of rtsock consumers. Add SIGALRM handler to prevent this.

Reviewed by: melifaro
Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC

7 years agoRegenerate timedef for zh_TW.
kevlo [Wed, 27 Jul 2016 08:11:08 +0000 (08:11 +0000)]
Regenerate timedef for zh_TW.

Reviewed by: bapt

7 years agoFix cldr2def.pl script to add weekday to the date format of zh_TW locales.
kevlo [Wed, 27 Jul 2016 08:08:46 +0000 (08:08 +0000)]
Fix cldr2def.pl script to add weekday to the date format of zh_TW locales.
While here, mention dependency on textproc/p5-XML-Parser in README.

Reviewed by: bapt

7 years agohyperv/vmbus: Cleanup RX bufring read process.
sephe [Wed, 27 Jul 2016 07:36:54 +0000 (07:36 +0000)]
hyperv/vmbus: Cleanup RX bufring read process.

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

7 years agohyperv/vmbus: Stringent RX bufring data length checks.
sephe [Wed, 27 Jul 2016 07:19:06 +0000 (07:19 +0000)]
hyperv/vmbus: Stringent RX bufring data length checks.

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

7 years agohyperv/vmbus: Cleanup TX bufring write process.
sephe [Wed, 27 Jul 2016 06:52:43 +0000 (06:52 +0000)]
hyperv/vmbus: Cleanup TX bufring write process.

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

7 years agoTestcase 7.8 no longer needs to be marked TODO
ngie [Wed, 27 Jul 2016 06:49:16 +0000 (06:49 +0000)]
Testcase 7.8 no longer needs to be marked TODO

It passes out of the box today

MFC after: 2 months
Sponsored by: EMC / Isilon Storage Division

7 years agohyperv/vmbus: Update comment for bufring
sephe [Wed, 27 Jul 2016 06:36:57 +0000 (06:36 +0000)]
hyperv/vmbus: Update comment for bufring

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

7 years agohyperv/vmbus: Use different struct for RX/TX bufring.
sephe [Wed, 27 Jul 2016 06:17:20 +0000 (06:17 +0000)]
hyperv/vmbus: Use different struct for RX/TX bufring.

So that they can use suitable MP synchronization mechanism.

While I'm here change the bufring init/read/write function names.

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

7 years agohyperv/vmbus: Initialize RX/TX bufring mutex at channel creation time
sephe [Wed, 27 Jul 2016 05:47:32 +0000 (05:47 +0000)]
hyperv/vmbus: Initialize RX/TX bufring mutex at channel creation time

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

7 years agoUpdate a comment to reflect r284376.
alc [Wed, 27 Jul 2016 03:49:00 +0000 (03:49 +0000)]
Update a comment to reflect r284376.

MFC after: 3 days

7 years agoAdd the NUM_CORE_FILES kernel config option which specifies the limit for the
stevek [Wed, 27 Jul 2016 03:21:02 +0000 (03:21 +0000)]
Add the NUM_CORE_FILES kernel config option which specifies the limit for the
number of core files allowed by a particular process when using the %I core
file name pattern.

Sanity check at compile time to ensure the value is within the valid range of
0-10.

Reviewed by: jtl, sjg
Approved by: sjg (mentor)
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D6812

7 years agoAdd weekday to the date format.
kevlo [Wed, 27 Jul 2016 00:46:48 +0000 (00:46 +0000)]
Add weekday to the date format.

7 years agoAnnotate the usb-serial drivers which always return 0 for line status,
ian [Wed, 27 Jul 2016 00:08:01 +0000 (00:08 +0000)]
Annotate the usb-serial drivers which always return 0 for line status,
so that it'll be easier to find and fix them in the future.

7 years ago- Change the fbuf "vga" parameter to "vga=on|io|off".
grehan [Wed, 27 Jul 2016 00:03:29 +0000 (00:03 +0000)]
- Change the fbuf "vga" parameter to "vga=on|io|off".
   "io" is the default, and allows VGA i/o registers to be
   accessed. This is required by Win7/2k8 graphics guests that
   use a combination of BIOS int10 and UEFI.
   "off" disables all VGA i/o and mem accesses.
   "on" is not yet hooked up, but will enable full VGA rendering.

   OpenBSD/UEFI >= 5.9 graphics guests can be booted using "vga=off"

- Allow "rfb" to be used instead of "tcp" for the fbuf VNC
  description. "tcp" will be removed at a future point and is
  kept as an alias.

Discussed with: Leon Dang
MFC after: 3 days

7 years agoTranslate modem status reg bits from ns16550 to SER_* values used by the
ian [Wed, 27 Jul 2016 00:03:18 +0000 (00:03 +0000)]
Translate modem status reg bits from ns16550 to SER_* values used by the
tty layer.

Also annotate a switch case fall-through per style(9).

7 years agoTranslate modem status reg bits from ns16550 to SER_* values used by the
ian [Tue, 26 Jul 2016 23:42:42 +0000 (23:42 +0000)]
Translate modem status reg bits from ns16550 to SER_* values used by the
tty layer.

Also annotate a switch case fall-through per style(9).

7 years agoCatch another case where an XHCI interrupt was being
grehan [Tue, 26 Jul 2016 23:40:25 +0000 (23:40 +0000)]
Catch another case where an XHCI interrupt was being
injected without state being set up.

This fixes a core dump when dropping to the UEFI prompt
with graphics enabled and moving the mouse around.

Discussed with: Leon Dang
MFC after: 3 days

7 years agocxgbe(4): Initialize the adapter queues (fwq and mgmtq) instead of
np [Tue, 26 Jul 2016 23:29:37 +0000 (23:29 +0000)]
cxgbe(4): Initialize the adapter queues (fwq and mgmtq) instead of
returning EAGAIN if they aren't available when the user tries to program
a filter.  Do this after validating the filter so that the driver
doesn't bring up the queues if it doesn't have to.

7 years agoTranslate modem status reg bits from ns16550 to SER_* values used by the
ian [Tue, 26 Jul 2016 23:27:28 +0000 (23:27 +0000)]
Translate modem status reg bits from ns16550 to SER_* values used by the
tty layer.  Also, the line status reg bits are already ns16550 as expected
by the ucom layer, so no need for translation or a local var to hold them.

7 years agoActually return line status register values from umoscom_cfg_get_status().
ian [Tue, 26 Jul 2016 22:26:49 +0000 (22:26 +0000)]
Actually return line status register values from umoscom_cfg_get_status().

The hardware delivers ns16550-compatible status bits, which is what the
usb_serial code expects, so no need for translation, no need for a local
variable to hold a temporary lsr result.

7 years agoMention AC3165 and AC8260 chipsets in iwm(4) and mention AC3165 in iwmfw(4)
ivadasz [Tue, 26 Jul 2016 21:27:02 +0000 (21:27 +0000)]
Mention AC3165 and AC8260 chipsets in iwm(4) and mention AC3165 in iwmfw(4)

- Support for the AC3165 and AC8260 chipsets was added by r303322 and r303327.

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

7 years agoFix the case for some sysctl descriptions.
brd [Tue, 26 Jul 2016 20:20:09 +0000 (20:20 +0000)]
Fix the case for some sysctl descriptions.

Reviewed by: gnn

7 years agoFix typing of srandom() and initstate().
ed [Tue, 26 Jul 2016 20:11:29 +0000 (20:11 +0000)]
Fix typing of srandom() and initstate().

POSIX requires that these functions have an unsigned int for their first
argument; not an unsigned long.

My reasoning is that we can safely change these functions without
breaking the ABI. As far as I know, our supported architectures either
use registers for passing function arguments that are at least as big as
long (e.g., amd64), or int and long are of the same size (e.g., i386).

Reviewed by: ache
Differential Revision: https://reviews.freebsd.org/D6644

7 years agoFix start date to not be in the future.
phil [Tue, 26 Jul 2016 18:27:48 +0000 (18:27 +0000)]
Fix start date to not be in the future.

Submitted by: phil
Reviewed by: sjg (mentor)
Approved by: sjg

7 years agoAdd shmatt_t.
ed [Tue, 26 Jul 2016 17:23:49 +0000 (17:23 +0000)]
Add shmatt_t.

It looks like our "struct shmid_ds::shm_nattch" deviates from the
standard in the sense that it is a signed integer, whereas POSIX
requires that it is unsigned, having a special type shmatt_t.

Patch up our native and 32-bit copies to use a new shmatt_t that is an
unsigned integer. As it's unsigned, we can relax the comparisons that
are performed on it. Leave the Linux, iBCS2, etc. copies of the
structure alone.

Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D6655

7 years agoUpdate my TODO items.
adrian [Tue, 26 Jul 2016 16:40:03 +0000 (16:40 +0000)]
Update my TODO items.

7 years agovt: lock Giant around kbd calls in CONS_GETINFO
emaste [Tue, 26 Jul 2016 15:34:26 +0000 (15:34 +0000)]
vt: lock Giant around kbd calls in CONS_GETINFO

Note that keyboards are stored in an array and are not freed (just
"unregistered" by clearing some fields) so a race would be limited to
obtaining stale information about an unregistered keyboard.

Reported by: CTurt
MFC after: 3 days

7 years agoapply some style(9) to kbd: make function name start in column 1
emaste [Tue, 26 Jul 2016 13:36:28 +0000 (13:36 +0000)]
apply some style(9) to kbd: make function name start in column 1

Sponsored by: The FreeBSD Foundation

7 years agohyperv/vmbus: Nuke unnecessary accessor functions.
sephe [Tue, 26 Jul 2016 05:06:00 +0000 (05:06 +0000)]
hyperv/vmbus: Nuke unnecessary accessor functions.

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

7 years agoAdd links for bit_ffc_at(3) and bit_ffs_at(3).
bdrewery [Tue, 26 Jul 2016 03:47:16 +0000 (03:47 +0000)]
Add links for bit_ffc_at(3) and bit_ffs_at(3).

MFC after: 3 days

7 years agoiwm(4) synchronize driver to DragonFlyBSD version and recent f/w update.
sbruno [Tue, 26 Jul 2016 00:02:17 +0000 (00:02 +0000)]
iwm(4) synchronize driver to DragonFlyBSD version and recent f/w update.

Submitted by: Kevin Bowling (kevin.bowling@kev009.com)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6967

7 years agoiwm(4): switch to ieee80211_runtask()
sbruno [Mon, 25 Jul 2016 23:44:44 +0000 (23:44 +0000)]
iwm(4): switch to ieee80211_runtask()

Submitted by: Andiry Voskoboinyk (s3erios@gmail.com)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D5054

7 years agoUpdate iwmfw(4) to include support for 8260 series units and update
sbruno [Mon, 25 Jul 2016 23:05:25 +0000 (23:05 +0000)]
Update iwmfw(4) to include support for 8260 series units and update
f/w for the other devices supported by this driver.

Patch linked in https://reviews.freebsd.org/D6967 but not actually
a part of the review.

Obtained from DragonflyBSD.

Submitted by:   Kevin Bowling <kev009@kev009.com>
MFC after:      2 weeks
Relnotes:       yes

7 years agomiwi resigned from FreeBSD, update the graph
rene [Mon, 25 Jul 2016 20:49:16 +0000 (20:49 +0000)]
miwi resigned from FreeBSD, update the graph

7 years agoRemove some extraneous printfs.
imp [Mon, 25 Jul 2016 19:16:30 +0000 (19:16 +0000)]
Remove some extraneous printfs.