]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years ago[evdev] Fix build for older versions of clang
Oleksandr Tymoshenko [Mon, 26 Dec 2016 17:48:13 +0000 (17:48 +0000)]
[evdev] Fix build for older versions of clang

There was report of stable/11 build failure on older versions of
FreeBSD. The problem was a reference to static variable in inline
function. Although fairly recent versions of clang can cope with this
situation just fine there is no strict requirement to make functions
in question inline, they're not in any time-critical codepath. So to
keep HEAD and 11-STABLE buildable on older FreeBSDs some of the util
functions were converted from inline to normal.

Reported by: hselasky
MFC after: 3 days

7 years ago - pstat(8) does not accept any arguments other than getopt() args,
Xin LI [Mon, 26 Dec 2016 17:34:27 +0000 (17:34 +0000)]
 - pstat(8) does not accept any arguments other than getopt() args,
   so don't bother to adjust argc/argv after getopt() loop.
 - Make a string pointer constant.

MFC after: 2 weeks

7 years agoDon't use high precision clock for expiration as only second portion is
Xin LI [Mon, 26 Dec 2016 17:23:09 +0000 (17:23 +0000)]
Don't use high precision clock for expiration as only second portion is
used.

MFC after: 2 weeks

7 years agoAvoid use after free.
Xin LI [Mon, 26 Dec 2016 17:10:41 +0000 (17:10 +0000)]
Avoid use after free.

Reported by: Clang static code analyzer
MFC after: 2 weeks

7 years agoImplement drivers for NVIDIA tegra124 display controller, HDMI source
Michal Meloun [Mon, 26 Dec 2016 14:36:05 +0000 (14:36 +0000)]
Implement drivers for NVIDIA tegra124 display controller, HDMI source
and host1x module. Unfortunately, tegra124 SoC doesn't have 2D acceleration
engine and 3D requires not yet started nouveau driver.

These drivers forms a first non-x86 DRM2 enabled graphic stack.

Note, there are 2 outstanding issues:
 - The code uses gross hack in order to be comply with
   OBJT_MGTDEVICE pager. (See tegra_bo_init_pager() in tegra_bo.c)
 - Due to improper(probably) refcounting in drm_gem_mmap_single()
   (in drm_gem.c), the gem objects are never released.
I hope that I will be able to address both issues in finite time,
but I don't want to touch x86 world now.

MFC after: 1 month

7 years agoImport drm_patform.c, an implementation of non-PCI based attachment
Michal Meloun [Mon, 26 Dec 2016 14:28:23 +0000 (14:28 +0000)]
Import drm_patform.c, an implementation of non-PCI based attachment
for graphics drivers.
It will be used in upcoming driver for Nvidia Tegra boards.

MFC after: 1 month

7 years agoFix late monitor hotplug event.
Michal Meloun [Mon, 26 Dec 2016 11:20:40 +0000 (11:20 +0000)]
Fix late monitor hotplug event.
If system starts without attached monitor, DRM create framebuffer
for VT console. Later, when monitor is attached, the hotplug event must
issue full modeset procedure to setup CRTC.
In original code, this was done in drm_fb_helper_set_par(), but we don't
have this function implemented yet. Use unrolled version of
drm_fb_helper_set_par() to ensure same functionality.

MFC after: 1 month

7 years agostyle(9): fix trailing whitespace
Enji Cooper [Mon, 26 Dec 2016 11:16:55 +0000 (11:16 +0000)]
style(9): fix trailing whitespace

MFC after: 3 days

7 years agoUpdate engine time using update_snmpd_engine_time(..)
Enji Cooper [Mon, 26 Dec 2016 11:11:30 +0000 (11:11 +0000)]
Update engine time using update_snmpd_engine_time(..)

MFC after: 6 days
X-MFC with: r310498
Sponsored by: Dell EMC Isilon

7 years agoWhitespace changes.
Michael Tuexen [Mon, 26 Dec 2016 11:06:41 +0000 (11:06 +0000)]
Whitespace changes.

The toolchain for processing the sources has been updated. No functional
change.

MFC after: 3 days

7 years agoImplement more list header file functions.
Hans Petter Selasky [Mon, 26 Dec 2016 10:41:51 +0000 (10:41 +0000)]
Implement more list header file functions.
Add definition guard for the list_head structure.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix return type for `ret` (recv callback) and sort variables by alignment
Enji Cooper [Mon, 26 Dec 2016 10:24:48 +0000 (10:24 +0000)]
Fix return type for `ret` (recv callback) and sort variables by alignment

Again, for reasons I don't yet understand, this is not being flagged by the
compiler. Unlike the issue addressed in r310587, this problem existed prior
to r310586

MFC after: 2 weeks
X-MFC with: r310586, r310587

7 years agoFix definition for recv_dgram(..); it should be "ssize_t", not "int"
Enji Cooper [Mon, 26 Dec 2016 10:21:28 +0000 (10:21 +0000)]
Fix definition for recv_dgram(..); it should be "ssize_t", not "int"

I'm not sure why this wasn't flagged as an issue by the compiler, yet

MFC after: 3 weeks
X-MFC with: r310586

7 years agoRefactor transport sources a bit to facilitate changes coming down pipeline
Enji Cooper [Mon, 26 Dec 2016 10:17:22 +0000 (10:17 +0000)]
Refactor transport sources a bit to facilitate changes coming down pipeline

Add recv callback to transport layer to better facilitate code reuse and
readability and for symmetry with send callback. Move recv_dgram and
recv_stream to udp_recv and lsock_recv, respectively, and make the
beforementioned functions recv callbacks for the udp and lsock transports,
respectively.

Consolidate the check_priv* functions in their relevant trans*.c source to
limit scope/use.

Note: this code is roughly based content from the submitter, although this
was modified to be more of a direct move from snmpd/main.c to the trans_*.c
sources, and to reduce unnecessary static function declarations.

MFC after: 2 weeks
Submitted by: Thor Steingrimsson <thor.steingrimsson@isilon.com>
Sponsored by: Dell EMC Isilon

7 years agoFix LINT build.
Hans Petter Selasky [Mon, 26 Dec 2016 10:03:33 +0000 (10:03 +0000)]
Fix LINT build.

Found by: mmel @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix improperly used nexus.targ_lun.
Alexander Motin [Mon, 26 Dec 2016 08:47:35 +0000 (08:47 +0000)]
Fix improperly used nexus.targ_lun.

MFC after: 2 weeks

7 years agoFix style(9)
Enji Cooper [Mon, 26 Dec 2016 07:31:16 +0000 (07:31 +0000)]
Fix style(9)

- Sort #includes
- Delete trailing whitespace

No functional change

MFC after: 3 days

7 years ago[vchi] replace non-reproducible __DATE__/__TIME__ with hardcoded string
Oleksandr Tymoshenko [Mon, 26 Dec 2016 02:51:03 +0000 (02:51 +0000)]
[vchi] replace non-reproducible __DATE__/__TIME__ with hardcoded string

Although vchiq_build_date and vchiq_build_time are not used in current
vchi driver at the moment, make sure these value will not leak into
build later on if at some point they will be refered in some new
imported code

PR: 215494
Reported by: emaste
MFC after: 1 week

7 years agoImplement register and unregister chrdev in the LinuxKPI.
Hans Petter Selasky [Mon, 26 Dec 2016 01:18:07 +0000 (01:18 +0000)]
Implement register and unregister chrdev in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoUse correct integer type when computing the maximum physical address
Hans Petter Selasky [Sun, 25 Dec 2016 21:41:40 +0000 (21:41 +0000)]
Use correct integer type when computing the maximum physical address
for kmem_alloc_contig().

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoUse the correct format specifier for physmem chunk sizes.
Justin Hibbits [Sun, 25 Dec 2016 20:19:32 +0000 (20:19 +0000)]
Use the correct format specifier for physmem chunk sizes.

Arguments are unsigned, so should be printed as unsigned.

7 years agoSome random code cleaning.
Alexander Motin [Sun, 25 Dec 2016 20:17:15 +0000 (20:17 +0000)]
Some random code cleaning.

 - Reduce indentation.
 - Remove extra braces.
 - Add few missing savety checks.

MFC after: 2 weeks

7 years agoSome optimizations for kqueue timers.
Konstantin Belousov [Sun, 25 Dec 2016 19:49:35 +0000 (19:49 +0000)]
Some optimizations for kqueue timers.

There is no need to do two allocations per kqueue timer. Gather all
data needed by the timer callout into the structure and allocate it at
once.

Use the structure to preserve the result of timer2sbintime(), to not
perform repeated 64bit calculations in callout.

Remove tautological casts.
Remove now unused p_nexttime [1].

Noted by: markj [1]
Reviewed by: markj (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-MFC note: do not remove p_nexttime
Differential revision: https://reviews.freebsd.org/D8901

7 years agoImprove LinuxKPI device support. Only delete own BSD devices and not
Hans Petter Selasky [Sun, 25 Dec 2016 19:49:09 +0000 (19:49 +0000)]
Improve LinuxKPI device support. Only delete own BSD devices and not
the ones obtained through devclass_get_device(). Some minor code
cleanups while at it.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoSome style.
Konstantin Belousov [Sun, 25 Dec 2016 19:38:07 +0000 (19:38 +0000)]
Some style.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D8901

7 years agoRemove a KASSERT which is not always true.
Michael Tuexen [Sun, 25 Dec 2016 17:37:18 +0000 (17:37 +0000)]
Remove a KASSERT which is not always true.

In case of the empty queue tp->snd_holes and tcp_sackhole_insert()
failing due to memory shortage, tp->snd_holes will be empty.
This problem was hit when stress tests where performed by pho.

PR: 215513
Reported by: pho
Tested by: pho
Sponsored by: Netflix, Inc.

7 years agoFix build of lib32 libraries for amd64 and powerpc64 with cross toolchain
Baptiste Daroussin [Sun, 25 Dec 2016 15:39:52 +0000 (15:39 +0000)]
Fix build of lib32 libraries for amd64 and powerpc64 with cross toolchain

7 years agoRemove CTL_MAX_LUNS from places where it is not required.
Alexander Motin [Sun, 25 Dec 2016 13:34:02 +0000 (13:34 +0000)]
Remove CTL_MAX_LUNS from places where it is not required.

MFC after: 2 weeks

7 years agoImprove third-party copy error reporting.
Alexander Motin [Sun, 25 Dec 2016 09:40:44 +0000 (09:40 +0000)]
Improve third-party copy error reporting.

For EXTENDED COPY:
 - improve parameters checking to report some errors before copy start;
 - forward sense data from copy target as descriptor in case of error;
 - report which CSCD reported error in sense key specific information.
For WRITE USING TOKEN:
 - pass through real sense data from copy target instead of reporting
our copy error, since for initiator its a "simple" write, not a copy.

MFC after: 2 weeks

7 years agoImprove IP address list representation in libxo output.
Jamie Gritton [Sat, 24 Dec 2016 23:51:27 +0000 (23:51 +0000)]
Improve IP address list representation in libxo output.

Extract decision-making about special-case printing of certain
jail parameters into a function.

Refactor emitting of IPv4 and IPv6 address lists into a function.

Resulting user-facing changes:

XO_VERSION is bumped to 2.

In verbose mode (-v), IPv4 and IPv6-Addresses are now properly emitted
as separate lists.
This only affects the output in encoding styles, i.e. xml and json.

{                                    {
  "__version": "1",                    "__version": "2",
  "jail-information": {                "jail-information": {
    "jail": [                            "jail": [
      {                                    {
        "jid": 166,                          "jid": 166,
        "hostname": "foo.com",               "hostname": "foo.com",
        "path": "/var/jail/foo",             "path": "/var/jail/foo",
        "name": "foo",                       "name": "foo",
        "state": "ACTIVE",                   "state": "ACTIVE",
        "cpusetid": 2,                       "cpusetid": 2,
        "ipv4_addrs": [                      "ipv4_addrs": [
          "10.1.1.1",                          "10.1.1.1",
          "10.1.1.2",                          "10.1.1.2",
          "10.1.1.3",              |           "10.1.1.3"
                                   >         ],
                                   >         "ipv6_addrs": [
          "fe80::1000:1",                      "fe80::1000:1",
          "fe80::1000:2"                       "fe80::1000:2"
        ]                                    ]
      }                                    }
    ]                                    ]
  }                                    }
}                                    }

In -n mode, ip4.addr and ip6.addr are formatted in the encoding styles'
native list types, e.g. instead of comma-separated lists, JSON arrays
are printed.

jls -n all --libxo json
 ...
 "ip4.addr": [
    "10.1.1.1",
    "10.1.1.2",
    "10.1.1.3"
  ],
  "ip4.saddrsel": true,
  "ip6.addr": [
    "fe80::1000:1",
    "fe80::1000:2"
  ],
  ...

jls -n all --libxo xml
  ...
  <ip4.addr>10.1.1.1</ip4.addr>
  <ip4.addr>10.1.1.2</ip4.addr>
  <ip4.addr>10.1.1.3</ip4.addr>
  <ip4.saddrsel>true</ip4.saddrsel>
  <ip6.addr>fe80::1000:1</ip6.addr>
  <ip6.addr>fe80::1000:2</ip6.addr>
  ...

PR: 215008
Submitted by: Christian Schwarz <me@cschwarz.com>
Differential Revision: https://reviews.freebsd.org/D8766

7 years agonet80211: fix 'pending CAC -> RUN transition lost' bug.
Andriy Voskoboinyk [Sat, 24 Dec 2016 23:43:14 +0000 (23:43 +0000)]
net80211: fix 'pending CAC -> RUN transition lost' bug.

Ensure that CAC -> RUN state transition will be requested
for every vap only once.

7 years ago- Fix -N flag (NoBind) for AF_LOCAL sockets.
Hiroki Sato [Sat, 24 Dec 2016 23:29:50 +0000 (23:29 +0000)]
- Fix -N flag (NoBind) for AF_LOCAL sockets.
- Do setsockopt(SO_RCVBUF) for AF_LOCAL sockets regardless of -s flag.

7 years agoFix gcc build.
Hiroki Sato [Sat, 24 Dec 2016 22:51:02 +0000 (22:51 +0000)]
Fix gcc build.

Spotted by: lidl

7 years agoImprove length handling when writing sense data.
Alexander Motin [Sat, 24 Dec 2016 17:42:34 +0000 (17:42 +0000)]
Improve length handling when writing sense data.

 - Allow maximal sense size limitation via Control Extension mode page.
 - When sense size limited, include descriptors atomically: whole or none.
 - Set new SDAT_OVFL bit if some descriptors don't fit the limit.
 - Report real written sense length instead of static maximal 252 bytes.

MFC after: 2 weeks

7 years agoUnbreak syslogd after r310494
Enji Cooper [Sat, 24 Dec 2016 12:50:17 +0000 (12:50 +0000)]
Unbreak syslogd after r310494

Don't close all file descriptors greater than STDERR_FILENO (2) in
waitdaemon(..) -- only close fd (file descriptor for /dev/null used in
subsequent calls to dup2) if it's greater than STDERR_FILENO.

Reported by: subbsd@gmail.com, danny@cs.huji.ac.il
Pointyhat to: hrs
X-MFC with: r310494

7 years agostyle(9): delete stray trailing whitespace after break statement
Enji Cooper [Sat, 24 Dec 2016 11:49:25 +0000 (11:49 +0000)]
style(9): delete stray trailing whitespace after break statement

MFC after: 3 days

7 years agoBe more strict about IpAddress type in snmp_value_parse(..)
Enji Cooper [Sat, 24 Dec 2016 11:41:16 +0000 (11:41 +0000)]
Be more strict about IpAddress type in snmp_value_parse(..)

- Use inet_pton with AF_INET instead of doing longhand with sscanf.
- Use gethostbyname2 with AF_INET to ensure that the hostname isn't
  accidentally parsed with another address family, e.g. AF_INET6.

NB: IpAddress per RFC-2578 is IPv4 only. Work is in progress to add
    the InetAddress type and friends documented in RFC-4001 and
    elsewhere (which supports IPv4, IPv6, and more).

MFC after: 2 weeks

7 years agoMinor style(9) fixes
Enji Cooper [Sat, 24 Dec 2016 11:30:24 +0000 (11:30 +0000)]
Minor style(9) fixes

- Trailing whitespace cleanup
- Sort variables in snmp_dialog(..) by alignment

No functional change

MFC after: 1 week

7 years agoSort #includes
Enji Cooper [Sat, 24 Dec 2016 11:26:55 +0000 (11:26 +0000)]
Sort #includes

No functional change

MFC after: 3 days

7 years agoAllow SNMPv3 authNoPriv and noAuthNoPriv protocols to discover snmpEngineTime
Enji Cooper [Sat, 24 Dec 2016 11:23:18 +0000 (11:23 +0000)]
Allow SNMPv3 authNoPriv and noAuthNoPriv protocols to discover snmpEngineTime
as discussed in RFC-5343

This fixes interoperability with net-snmp.

Tested with the following invocations of snmpwalk (from net-snmp):

- noAuthNoPriv:

  % snmpwalk -v 3 -n '' -u public localhost snmpEngineTime

- authNoPriv:

  % snmpwalk -v 3 -n '' -u bsnmp -A bsnmptest -l authNoPriv -a sha localhost \
    localhost snmpEngineTime

- authPriv:

  % snmpwalk -v 3 -n '' -u bsnmp -A bsnmptest -l authPriv -a sha -x des \
    -X bsnmptest localhost snmpEngineTime

MFC after: 1 week
Obtained from: Isilon OneFS (5ec6d772cacbc, with minor tweaks)
Submitted by: Austin Voecks <austin.voecks@isilon.com>
Sponsored by: Dell EMC Isilon

7 years agoWarning message cleanup
Enji Cooper [Sat, 24 Dec 2016 11:22:28 +0000 (11:22 +0000)]
Warning message cleanup

- Use warn instead of warnx + strerror(errno)
- Remove unnecessary trailing newline from a warnx call
- Add missing spaces following "," in syslog and warn* calls

MFC after: 2 weeks

7 years agoFix argument type and microoptimize swp_pager_meta_free().
Konstantin Belousov [Sat, 24 Dec 2016 09:57:31 +0000 (09:57 +0000)]
Fix argument type and microoptimize swp_pager_meta_free().

The count argument natural type if vm_pindex_t, but due to the loop
organization, it has to be signed type to detect the termination
condition.  Replace this logic by using distinguished counter for the
processed pages, and terminate loop when the counter exceeds the
argument.

Completely process one swblock for all relevant indexes instead of
doing relookup in hash when incrementing page index on the loop step.

Do not drop hash mutex around iterations.

Noted and reviewed by: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years ago- Remove unused code.
Hiroki Sato [Sat, 24 Dec 2016 07:13:33 +0000 (07:13 +0000)]
- Remove unused code.
- Use closefrom().

7 years agoAdd driver for JZ4780 RTC device.
Alexander Kabaev [Sat, 24 Dec 2016 02:31:26 +0000 (02:31 +0000)]
Add driver for JZ4780 RTC device.

Only support basic timekeeping for now.

7 years ago[spigen] Fix spigen attaching as a driver for SPI devices nodes in FDT
Oleksandr Tymoshenko [Sat, 24 Dec 2016 00:30:29 +0000 (00:30 +0000)]
[spigen] Fix spigen attaching as a driver for SPI devices nodes in FDT

Return BUS_PROBE_NOWILDCARD in probe method to make sure that spigen
attaches only to the device created in identify method.

Before this change spigen probe method used to return 0 which meant it
competed with other drivers to be attached to the devices created for
child nodes of SPI bus node in FDT.

Reported by: Daniel Braniss
MFC after: 1 week

7 years agoFix NFSv4.1 client recovery from NFS4ERR_BAD_SESSION errors.
Rick Macklem [Fri, 23 Dec 2016 23:14:53 +0000 (23:14 +0000)]
Fix NFSv4.1 client recovery from NFS4ERR_BAD_SESSION errors.

For most NFSv4.1 servers, a NFS4ERR_BAD_SESSION error is a rare failure
that indicates that the server has lost session/open/lock state.
However, recent testing by cperciva@ against the AmazonEFS server found
several problems with client recovery from this due to it generating this
failure frequently.
Briefly, the problems fixed are:
- If all session slots were in use at the time of the failure, some processes
  would continue to loop waiting for a slot on the old session forever.
- If an RPC that doesn't use open/lock state failed with NFS4ERR_BAD_SESSION,
  it would fail the RPC/syscall instead of initiating recovery and then
  looping to retry the RPC.
- If a successful reply to an RPC for an old session wasn't processed
  until after a new session was created for a NFS4ERR_BAD_SESSION error,
  it would erroneously update the new session and corrupt it.
- The use of the first element of the session list in the nfs mount
  structure (which is always the current metadata session) was slightly
  racey. With changes for the above problems it became more racey, so all
  uses of this head pointer was wrapped with a NFSLOCKMNT()/NFSUNLOCKMNT().
- Although the kernel malloc() usually allocates more bytes than requested
  and, as such, this wouldn't have caused problems, the allocation of a
  session structure was 1 byte smaller than it should have been.
  (Null termination byte for the string not included in byte count.)

There are probably still problems with a pNFS data server that fails
with NFS4ERR_BAD_SESSION, but I have no server that does this to test
against (the AmazonEFS server doesn't do pNFS), so I can't fix these yet.

Although this patch is fairly large, it should only affect the handling
of NFS4ERR_BAD_SESSION error replies from an NFSv4.1 server.
Thanks go to cperciva@ for the extension testing he did to help isolate/fix
these problems.

Reported by: cperciva
Tested by: cperciva
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D8745

7 years agoImplement printing forwarded sense data.
Alexander Motin [Fri, 23 Dec 2016 21:56:08 +0000 (21:56 +0000)]
Implement printing forwarded sense data.

MFC after: 2 weeks

7 years agomlx(4): remove date from log message
Ed Maste [Fri, 23 Dec 2016 20:14:05 +0000 (20:14 +0000)]
mlx(4): remove date from log message

Further to r310425, go one step further and just remove the date.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D8888

7 years agoPass memattrs to fb device so that user mappings can inherit them
Alexander Kabaev [Fri, 23 Dec 2016 19:30:14 +0000 (19:30 +0000)]
Pass memattrs to fb device so that user mappings can inherit them

Reviewed by: jmcneill

7 years agoMove the objects used to create temporary mappings for i386 pmap zero and copy
Jason A. Harmening [Fri, 23 Dec 2016 15:14:56 +0000 (15:14 +0000)]
Move the objects used to create temporary mappings for i386 pmap zero and copy
operations to the MD PCPU region.  Change sysmap initialization to only
allocate KVA pages for CPUs that are actually present.  As a minor
optimization, this also prevents false sharing between adjacent sysmap objects
since the pcpu struct is already cacheline-aligned.

While here, move pc_qmap_addr initialization for the BSP into
pmap_bootstrap(), which allows use of pmap_quick* functions during early boot.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8833

7 years agoAdd place-holders for TAPE STREAM MIRRORING subcommands of XCOPY.
Alexander Motin [Fri, 23 Dec 2016 14:54:40 +0000 (14:54 +0000)]
Add place-holders for TAPE STREAM MIRRORING subcommands of XCOPY.

We do not support tapes, so this is only a comments.

MFC after: 2 weeks

7 years agoProvide some guidance when dealing with sections and variables contained
Enji Cooper [Fri, 23 Dec 2016 08:59:23 +0000 (08:59 +0000)]
Provide some guidance when dealing with sections and variables contained
within them

For example, using variables designated for %usm requires uncommenting
%usm section header

MFC after: 1 month

7 years agoDon't hardcode $(securityModelUSM) (3) in the authPriv example under the %vacm
Enji Cooper [Fri, 23 Dec 2016 08:54:44 +0000 (08:54 +0000)]
Don't hardcode $(securityModelUSM) (3) in the authPriv example under the %vacm
section

MFC after: 1 week

7 years agohyperv/ic: Allow applying the samples from hypervisor unconditionally.
Sepherosa Ziehau [Fri, 23 Dec 2016 08:52:10 +0000 (08:52 +0000)]
hyperv/ic: Allow applying the samples from hypervisor unconditionally.

MFC after: 1 week
Sponsored by: Microsoft

7 years agohyperv/ic: Fix version4 timesync message format.
Sepherosa Ziehau [Fri, 23 Dec 2016 08:41:28 +0000 (08:41 +0000)]
hyperv/ic: Fix version4 timesync message format.

It is not compat w/ the old timesync message format, which the message
type stays the same as the old timesync message.

MFC after: 1 week
Sponsored by: Microsoft

7 years agoSort #includes per style(9)
Enji Cooper [Fri, 23 Dec 2016 07:55:13 +0000 (07:55 +0000)]
Sort #includes per style(9)

No functional change

MFC after: 3 days

7 years agoGroup all loadable modules in the %default section
Enji Cooper [Fri, 23 Dec 2016 06:56:48 +0000 (06:56 +0000)]
Group all loadable modules in the %default section

This will allow new users to uncomment the modules and have things work
with less head scratching, in the event they decide to uncomment any
of the section separators, e.g. %usm or %vcm, as the module loading is
only effective in the %default section.

MFC after: 1 week

7 years agoClean up trailing whitespace
Enji Cooper [Fri, 23 Dec 2016 06:35:18 +0000 (06:35 +0000)]
Clean up trailing whitespace

No functional change

MFC after: 3 days

7 years ago- More ifdef INET and INET6.
Hiroki Sato [Fri, 23 Dec 2016 06:29:24 +0000 (06:29 +0000)]
- More ifdef INET and INET6.
- Use STDERR_FILENO + 1 instead of "3".
- Fix dprintf() in cvthname().

7 years agoClarify failure in snmp_output(..) with call to snmp_pdu_decode
Enji Cooper [Fri, 23 Dec 2016 05:07:28 +0000 (05:07 +0000)]
Clarify failure in snmp_output(..) with call to snmp_pdu_decode

- Explicitly test snmp_pdu_encode against SNMP_CODE_OK instead of assuming
  any non-zero value is bad.
- Print out the code before calling abort() to give the end-user something
  actionable to debug without having to recompile the binary, since the
  core might not have these details.

MFC after: 1 week

7 years agoAdd a comment explaining the race fixed by r310423.
Mark Johnston [Fri, 23 Dec 2016 05:02:17 +0000 (05:02 +0000)]
Add a comment explaining the race fixed by r310423.

Suggested and reviewed by: jhb
X-MFC With: r310423

7 years agomdoc and style fixes.
Hiroki Sato [Fri, 23 Dec 2016 04:59:22 +0000 (04:59 +0000)]
mdoc and style fixes.

7 years agomdoc fixes.
Hiroki Sato [Fri, 23 Dec 2016 04:38:27 +0000 (04:38 +0000)]
mdoc fixes.

7 years agoTeach DDB how to unwind across a kernel stack overflow.
John Baldwin [Fri, 23 Dec 2016 03:27:11 +0000 (03:27 +0000)]
Teach DDB how to unwind across a kernel stack overflow.

Kernel stack overflows in MIPS call panic() directly from an assembly
handler after storing the interrupted context's registers in a
trapframe.  Rather than inferring the location of ra, sp, and pc from
the instruction stream, recognize the pc of a kernel stack overflow
and pull the registers from the trapframe.

Sponsored by: DARPA / AFRL

7 years agoMFamd64: Various fixes for MIPS minidumps.
John Baldwin [Fri, 23 Dec 2016 03:20:34 +0000 (03:20 +0000)]
MFamd64: Various fixes for MIPS minidumps.

- Honor PG_NODUMP by not dumping pages with this flag set.
- Pat the watchdog during dumps to avoid a watchdog reset while writing
  out a dump.
- Reformat the output during a dump to update every 10% done rather than
  every 2MB dumped.
- Include UMA small pages and pages holding PV entries in minidumps.

Sponsored by: DARPA / AFRL

7 years agoUpdate meta* from bmake-20161212
Simon J. Gerraty [Fri, 23 Dec 2016 02:57:00 +0000 (02:57 +0000)]
Update meta* from bmake-20161212

7 years ago[net80211] WEP offload support.
Adrian Chadd [Thu, 22 Dec 2016 23:59:53 +0000 (23:59 +0000)]
[net80211] WEP offload support.

Yes, the ath10k NIC actually also does do WEP TX/RX offload.

Tested:

* ath10k driver port, WEP STA mode.

7 years ago- Add -S option to specify the source address/port for UDP communication.
Hiroki Sato [Thu, 22 Dec 2016 23:39:11 +0000 (23:39 +0000)]
- Add -S option to specify the source address/port for UDP communication.
- Document -S option.
- Document that -h option supports AF_LOCAL.
- Split preparation of UDP sockets in logmessage() into socksetup().

7 years agoRevert r310138
Enji Cooper [Thu, 22 Dec 2016 22:30:42 +0000 (22:30 +0000)]
Revert r310138

Adding %b support to vfprintf for parity with kernel space requires
more discussion/review.

In particular, many parties were concerned over introducing a
non-standard format qualifier to *printf(3) which didn't already
exist in other OSes, e.g. Linux, thus making code which used %b
harder to port to other operating systems.

Requested by: many

7 years agoUse ${.OBJDIR} to refer to the kernel build object dir, instead of trying
Ian Lepore [Thu, 22 Dec 2016 21:11:42 +0000 (21:11 +0000)]
Use ${.OBJDIR} to refer to the kernel build object dir, instead of trying
to recreate it from ${MAKEOBJDIRPREFIX} and ${SRC_BASE} and ${KERNCONF},
the latter being especially problematic when KERNCONF is set to the names
of multiple kernel configs.

7 years ago[rsu] convert rsu to use the ieee80211_rx_stats struct to pass up RSSI, PHY and rate...
Adrian Chadd [Thu, 22 Dec 2016 21:01:56 +0000 (21:01 +0000)]
[rsu] convert rsu to use the ieee80211_rx_stats struct to pass up RSSI, PHY and rate information.

I don't yet know which RX descriptor bits map to shortgi, long-gi,
short-preamble, long-preamble, STBC, LDPC, HT40, etc - so I can't
easily add those just yet.

There's apparently no per-frame RX RSSI information exposed so we
also just use the results from the previous calibration task.

This also tidies up how the per-mbuf RSSI is pushed into the frame -
now that it's attached to the mbuf via rx_stats, we don't have to
do any silly hijinx to get it out of the frame processing path.

Tested:

* RTL8712, 1x1 cut 3, STA mode

7 years agoFix dump_avail[] for MALTA platforms to include the kernel.
John Baldwin [Thu, 22 Dec 2016 20:28:06 +0000 (20:28 +0000)]
Fix dump_avail[] for MALTA platforms to include the kernel.

dump_avail[] is supposed to be a superset of phys_avail[] that
describes all of the memory ranges that should be included in a full
dump.  minidumps don't consider pages described by dump_avail[] to be
valid and thus they are excluded via the is_dumpable() function.  Most
MIPS platforms (including MALTA) set dump_avail[] to be identical to
phys_avail[].  In particular, phys_avail[] doesn't include the kernel
itself, so pages for the kernel and it's global variables are not
considered dumpable and not included in the dump.  Fix this by setting
dump_avail[0] to the first memory address (0) rather than the end of
the kernel.

Several other MIPS platforms have the same bug, though I am only able
to test malta in qemu.  The correct fix is to set dump_avail[] to
describe RAM and in particular to not set dump_avail[0] to the end of
the kernel (kernel_kseg0_end).

Sponsored by: DARPA / AFRL

7 years agoIf you are going to be run individually to make a new timezone set
Julian Elischer [Thu, 22 Dec 2016 18:30:29 +0000 (18:30 +0000)]
If you are going to be run individually to make a new timezone set
then ensure the destination directories exist.
Especially if you define OLDTIMEZONES because the mtree pass
doesn't do it for you.

MFC after: 1 week
Sponsored by: Panzura

7 years agomlx: avoid use of __DATE__ to make build reproducible
Ed Maste [Thu, 22 Dec 2016 18:26:21 +0000 (18:26 +0000)]
mlx: avoid use of __DATE__ to make build reproducible

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D8886

7 years agoReplace passive voice with active voice and other tweaks.
John Baldwin [Thu, 22 Dec 2016 18:05:22 +0000 (18:05 +0000)]
Replace passive voice with active voice and other tweaks.

- Drop uses of 'will'.
- Replace 'to use' with active voice.
- Tidy language around interrupt types and clarify that INTx doesn't
  work on VFs.
- Drop leading articles from sysctl/tunable descriptions.
- Tweak the wording of several sysctl/tunable descriptions.

Submitted by: wblock (1, 2, 4)
Sponsored by: Chelsio Communications
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D8812

7 years agoRevert part of r300109.
Mark Johnston [Thu, 22 Dec 2016 17:51:44 +0000 (17:51 +0000)]
Revert part of r300109.

The removal of TAILQ_FOREACH_SAFE introduced a small race: when the last
thread on a sleepqueue is awoken, it reclaims the sleepqueue and may begin
executing on a different CPU before sleepq_resume_thread() returns. This
leaves a window during which it may go back to sleep and incorrectly be
awoken again by the caller of sleepq_broadcast().

Reported and tested by: pho
MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agortld: Fix a couple of bugs around the unloading of ELF filters.
Mark Johnston [Thu, 22 Dec 2016 17:44:27 +0000 (17:44 +0000)]
rtld: Fix a couple of bugs around the unloading of ELF filters.

- Pass the correct object to unload_filtees().
- Use a marker to restart iteration after unload_filtees() has returned.
  It calls dlclose() and may recursively remove entries from the global
  object list, so TAILQ_FOREACH_SAFE is not sufficient.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agortld: Ensure that dlopen() cannot obtain a reference on a doomed object.
Mark Johnston [Thu, 22 Dec 2016 17:41:32 +0000 (17:41 +0000)]
rtld: Ensure that dlopen() cannot obtain a reference on a doomed object.

rtld drops the bind lock to call fini functions in an object prior to
unmapping it. The new "doomed" state flag prevents the acquisition of new
references for an object while the lock is dropped.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agortld: Fix a race between dl_iterate_phdr() and dlclose().
Mark Johnston [Thu, 22 Dec 2016 17:37:39 +0000 (17:37 +0000)]
rtld: Fix a race between dl_iterate_phdr() and dlclose().

Add a transient reference count to ensure that the phdr argument to the
callback remains valid while the bind lock is dropped.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoxen: fix IPI setup with EARLY_AP_STARTUP
Roger Pau Monné [Thu, 22 Dec 2016 16:09:44 +0000 (16:09 +0000)]
xen: fix IPI setup with EARLY_AP_STARTUP

Current Xen IPI setup functions require that the caller provide a device in
order to obtain the name of the interrupt from it. With early AP startup this
device is no longer available at the point where IPIs are bound, and a KASSERT
would trigger:

panic: NULL pcpu device_t
cpuid = 0
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff82233a20
vpanic() at vpanic+0x186/frame 0xffffffff82233aa0
kassert_panic() at kassert_panic+0x126/frame 0xffffffff82233b10
xen_setup_cpus() at xen_setup_cpus+0x5b/frame 0xffffffff82233b50
mi_startup() at mi_startup+0x118/frame 0xffffffff82233b70
btext() at btext+0x2c

Fix this by no longer requiring the presence of a device in order to bind IPIs,
and simply use the "cpuX" format where X is the CPU identifier in order to
describe the interrupt.

Reported by:            sbruno, cperciva
Tested by:              sbruno
X-MFC-With:             r310177
Sponsored by:           Citrix Systems R&D

7 years agoAdd a dumpdev example to /boot/defaults/loader.conf
Alan Somers [Thu, 22 Dec 2016 15:48:54 +0000 (15:48 +0000)]
Add a dumpdev example to /boot/defaults/loader.conf

Submitted by: rgrimes
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

7 years agoAllwinner clk: factor M for mod clock is 4 bits, not 5
Emmanuel Vadot [Thu, 22 Dec 2016 15:01:06 +0000 (15:01 +0000)]
Allwinner clk: factor M for mod clock is 4 bits, not 5

MFC after: 1 week

7 years ago- Fix a use-after-free bug when dq_timeout == 1 and
Hiroki Sato [Thu, 22 Dec 2016 13:46:17 +0000 (13:46 +0000)]
- Fix a use-after-free bug when dq_timeout == 1 and
  sending SIGTERM to the process failed.  It is an
  unusual situation but it can happen.
- Split deadq_remove() into deadq_remove() and
  deadq_removebypid().
- Normalize variable names of struct deadq_entry *.

7 years agoAdd support for REPD bit in RSTMF command.
Alexander Motin [Thu, 22 Dec 2016 12:18:40 +0000 (12:18 +0000)]
Add support for REPD bit in RSTMF command.

We have no real timeout values to report there, but its better then error.

MFC after: 2 weeks

7 years agoFix REPORT SUPPORTED OPERATION CODES for READ/WRITE BUFFER commands.
Alexander Motin [Thu, 22 Dec 2016 11:10:11 +0000 (11:10 +0000)]
Fix REPORT SUPPORTED OPERATION CODES for READ/WRITE BUFFER commands.

Specifications require MODE parameter of those commands to be treated
the same as SERVICE ACTION parameter of other commands.

MFC after: 2 weeks

7 years agoMake a read only pointer constant.
Hans Petter Selasky [Thu, 22 Dec 2016 10:12:19 +0000 (10:12 +0000)]
Make a read only pointer constant.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agoAdd more comments regarding collection of statistics counters.
Hans Petter Selasky [Thu, 22 Dec 2016 10:11:03 +0000 (10:11 +0000)]
Add more comments regarding collection of statistics counters.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agoAdd a missing "default:" case.
Hiroki Sato [Thu, 22 Dec 2016 05:57:45 +0000 (05:57 +0000)]
Add a missing "default:" case.

7 years agoInitialize a structure by using a compound literal to avoid forgetting
Hiroki Sato [Thu, 22 Dec 2016 05:55:44 +0000 (05:55 +0000)]
Initialize a structure by using a compound literal to avoid forgetting
to zero unspecified members.

7 years agoFix debug log in the case of AF_INET6.
Hiroki Sato [Thu, 22 Dec 2016 05:28:30 +0000 (05:28 +0000)]
Fix debug log in the case of AF_INET6.

7 years ago- Simplify masklen->netmask conversion for AF_INET6.
Hiroki Sato [Thu, 22 Dec 2016 05:23:38 +0000 (05:23 +0000)]
- Simplify masklen->netmask conversion for AF_INET6.
- Use iov[N] by array index instead of using pointer v = &iov[0] to
  make the compiler catch an out-of-range access of the array.

7 years agoConvert tunefs use to nmount(2)
Brooks Davis [Thu, 22 Dec 2016 00:35:12 +0000 (00:35 +0000)]
Convert tunefs use to nmount(2)

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

7 years agoow_temp: Update the temperature visible via the sysctl atomically, rather
Gavin Atkinson [Thu, 22 Dec 2016 00:09:53 +0000 (00:09 +0000)]
ow_temp: Update the temperature visible via the sysctl atomically, rather
than using it as temporary calculation space.

7 years agoow_temp: Correct typo in comment
Gavin Atkinson [Wed, 21 Dec 2016 23:54:12 +0000 (23:54 +0000)]
ow_temp: Correct typo in comment

7 years agoRemove assigned only variable.
Gleb Smirnoff [Wed, 21 Dec 2016 22:47:10 +0000 (22:47 +0000)]
Remove assigned only variable.

7 years ago[iwn] Several fixes for DMA part of iwn(4)
Oleksandr Tymoshenko [Wed, 21 Dec 2016 22:35:26 +0000 (22:35 +0000)]
[iwn] Several fixes for DMA part of iwn(4)

- Perform DMS sync when accessing/initializing ICT table
- Fix some DMA sync operations to use matching tags

Reviewed by: avos
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D8804

7 years agoAdd support for REPORTING OPTIONS == 3 in REPORT SUPPORTED OPERATION CODES.
Alexander Motin [Wed, 21 Dec 2016 20:19:12 +0000 (20:19 +0000)]
Add support for REPORTING OPTIONS == 3 in REPORT SUPPORTED OPERATION CODES.

MFC after: 2 weeks

7 years agobhnd: remove srand() to ensure deterministic output
Ed Maste [Wed, 21 Dec 2016 15:45:23 +0000 (15:45 +0000)]
bhnd: remove srand() to ensure deterministic output

r310342 fixed non-deterministic nvram_map_gen.awk output and thus a non-
reproducible bhnd(4) build by using a unique sort key.

Go one step further and also remove the srand() call. There's no reason
we want non-deterministic behaviour from this script.

PR: 215422
Reported by: gjb (non-reproducibility of bhnd)
Reported by: lidl (srand as the cause)
Reviewed by: landonf
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8857

7 years agopax(1): Fix a bug with archives smaller than 512 bytes.
Pedro F. Giffuni [Wed, 21 Dec 2016 15:26:59 +0000 (15:26 +0000)]
pax(1): Fix a bug with archives smaller than 512 bytes.

The problem here is that the archive is too short (< 512 bytes). The
buffer routines, try to read at least 512 bytes, even when we try to
determine what format file we have, which is wrong.

Obtained from: NetBSD (CVS rev 1.26)
MFC after: 5 days

7 years agoAdd support for SITUA bit in Logical Block Provisioning mode page.
Alexander Motin [Wed, 21 Dec 2016 15:17:47 +0000 (15:17 +0000)]
Add support for SITUA bit in Logical Block Provisioning mode page.

VMware tries to enable this bit to avoid multiple threshold notifications
in case of multiple initiators connected to the same LUN.  Unfortunately
their code sends MODE SELECT(6) request with parameter length hardcoded
for the page without any thresholds.  Since we have four threshold and our
page is bigger, this attempt fails, that is correct in my understanding.
So all we can do about this now is to report proper error code and hope
VMware fix their code one day.

MFC after: 2 weeks