]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC 309552
sevan [Thu, 30 Mar 2017 01:30:27 +0000 (01:30 +0000)]
MFC 309552

Adjust formatting highlighted by igor.

PR: 214683
Submitted by: Anindya Mukherjee <anindya49 AT hotmail DOT com>
Reviewed by: jilles
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8591

7 years agoMFC 312684
sevan [Thu, 30 Mar 2017 01:18:58 +0000 (01:18 +0000)]
MFC 312684

Extend manual to cover more commands and options.

PR:             203406
Submitted by:   Fehmi Noyan Isi (fnoyanisi AT yahoo DOT com)
Approved by:    wblock (mentor)
Differential Revision:   https://reviews.freebsd.org/D8691

7 years agoMFC 315964
sevan [Thu, 30 Mar 2017 00:58:04 +0000 (00:58 +0000)]
MFC 315964
ftp.microsoft.com is dead and the document was not archived, point to the full
protocol spec document instead.
Fix spelling mistake flagged by igor.
Rephrase bad sentence flagged by igor.

Approved by:  bcr (mentor)
Differential Revision:  https://reviews.freebsd.org/D10111

7 years agoMFC r315545: Remove hackish code delaying ATIOs to unknown virtual port.
mav [Wed, 29 Mar 2017 16:16:39 +0000 (16:16 +0000)]
MFC r315545: Remove hackish code delaying ATIOs to unknown virtual port.

Since we support RQSTYPE_RPT_ID_ACQ, that functionality is only useful
in loop mode, which probably doesn't worth having this hack in 2017.

7 years agoMFC r315536: Move <= 23xx PDB workaround to generic code.
mav [Wed, 29 Mar 2017 16:15:18 +0000 (16:15 +0000)]
MFC r315536: Move <= 23xx PDB workaround to generic code.

It is chip-specific and has nothing to do with platform.

7 years agoMFC r315534: Remove some dead stuff.
mav [Wed, 29 Mar 2017 16:14:04 +0000 (16:14 +0000)]
MFC r315534: Remove some dead stuff.

7 years agoMFC r315533: Move 24xx RQSTYPE_NOTIFY handling to generic code.
mav [Wed, 29 Mar 2017 16:12:41 +0000 (16:12 +0000)]
MFC r315533: Move 24xx RQSTYPE_NOTIFY handling to generic code.

This code has nothing to do with specific platform.

7 years agoMFC r315507: Reorganize RQSTYPE_NOTIFY handling for chips <= 23xx.
mav [Wed, 29 Mar 2017 16:10:34 +0000 (16:10 +0000)]
MFC r315507: Reorganize RQSTYPE_NOTIFY handling for chips <= 23xx.

There were two copies of the code: one in generic code was half-broken, and
another in platform code was never called.  Leave only one in generic code
and working.

7 years agoMFC r315489: Move RQSTYPE_ABTS_RCVD parsing into generic code.
mav [Wed, 29 Mar 2017 16:03:33 +0000 (16:03 +0000)]
MFC r315489: Move RQSTYPE_ABTS_RCVD parsing into generic code.

7 years agoMFC r315488: Extend nt_lun to full 8 byte.
mav [Wed, 29 Mar 2017 16:02:19 +0000 (16:02 +0000)]
MFC r315488: Extend nt_lun to full 8 byte.

7 years agoMFC r315485: Remove dead remnants of SPI target.
mav [Wed, 29 Mar 2017 15:57:50 +0000 (15:57 +0000)]
MFC r315485: Remove dead remnants of SPI target.

7 years agoMFC r315482: Use isp_target_put_entry() in places where it can be.
mav [Wed, 29 Mar 2017 15:56:25 +0000 (15:56 +0000)]
MFC r315482: Use isp_target_put_entry() in places where it can be.

This unifies the code and removes some duplication.

7 years agoMFC r315478: Do some notify acks cleanup.
mav [Wed, 29 Mar 2017 15:45:04 +0000 (15:45 +0000)]
MFC r315478: Do some notify acks cleanup.

ISPASYNC_TARGET_NOTIFY_ACK makes no sense without argument.

7 years agoMFC r315327: Remove not very useful ATIO/INOT stats.
mav [Wed, 29 Mar 2017 15:43:51 +0000 (15:43 +0000)]
MFC r315327: Remove not very useful ATIO/INOT stats.

While there polish respective debug logging.

7 years agoMFC r315307: Refactor interrupt handling.
mav [Wed, 29 Mar 2017 15:42:35 +0000 (15:42 +0000)]
MFC r315307: Refactor interrupt handling.

Instead of single isp_intr() function doing all possible magic, introduce
four different functions to handle mailbox operation completions, async
events, response and ATIO queues.  The goal is to isolate different code
paths to make code more readable, and to make easier support for multiple
interrupt vectors.  Even oldest hardware in many cases can identify what
code path it should run on interrupt.  Contemporary hardware can assign
them to different interrupt vectors.

7 years agoMFC r315303: Fix panic when SIM dereferenced before allocation.
mav [Wed, 29 Mar 2017 15:40:45 +0000 (15:40 +0000)]
MFC r315303: Fix panic when SIM dereferenced before allocation.

7 years agoMFC r315298: Fix ancient bug from r84597, which broke 23xx after r315234.
mav [Wed, 29 Mar 2017 15:39:13 +0000 (15:39 +0000)]
MFC r315298: Fix ancient bug from r84597, which broke 23xx after r315234.

7 years agoMFC r314870: Add mechanism to unload CAM periph drivers.
mav [Wed, 29 Mar 2017 15:25:34 +0000 (15:25 +0000)]
MFC r314870: Add mechanism to unload CAM periph drivers.

For now it allows to unload CTL kernel module if there are no target-capable
SIMs in CAM.  As next step full teardown of CAM targets can be implemented.

7 years agoMFC r315711: Fix printing bits above first eight.
mav [Wed, 29 Mar 2017 14:57:41 +0000 (14:57 +0000)]
MFC r315711: Fix printing bits above first eight.

7 years agoMFC r315331:
kib [Wed, 29 Mar 2017 11:03:08 +0000 (11:03 +0000)]
MFC r315331:
Implement LD_BIND_NOT knob for rtld.

MFC r315337:
Disable LD_BIND_NOT for setugid processes.

MFC r315429 (by jilles):
Document that LD_BIND_NOT is unset for setugid processes.

7 years agoMFC r309068 (by jhb):
kib [Wed, 29 Mar 2017 10:59:46 +0000 (10:59 +0000)]
MFC r309068 (by jhb):
Fix _mips_rtld_bind() to handle ELF filters.

7 years agoMFC r315738:
ngie [Wed, 29 Mar 2017 08:01:38 +0000 (08:01 +0000)]
MFC r315738:

Document some more 10GbE+ network drivers in loader.conf

- if_cxgbe
- if_ixl
- if_ixlv
- sfxge

7 years agoMFC r315699:
ngie [Wed, 29 Mar 2017 08:00:13 +0000 (08:00 +0000)]
MFC r315699:

Print out name of non-dynamic sysctl in sysctl_remove_oid_locked

This will provide a slightly better smoking gun than just stating
"can't remove non-dynamic nodes!" when calling sysctl_ctx_free(9)
and sysctl_remove_{name,oid}(9) with a non-dynamic (likely
static) sysctl.

7 years agoMFC r315697:
ngie [Wed, 29 Mar 2017 07:30:59 +0000 (07:30 +0000)]
MFC r315697:

libkvm: fix warning issues post-r291406

- Fix -Wunused warnings with *_native detection handlers by marking `kd`
  __unused, except with arm/mips, where a slightly more complicated scheme
  is required to handle the native case vs the non-native case.
- Fix -Wmissing-variable-declarations warnings by marking struct kvm_arch
  objects static.

Tested with: WIP test code (D10024) // kgdb7121 (i386 crash/kernel on amd64)

7 years agoMFC r315201, r315920, r315921, r315922, r316008, and r316062.
np [Wed, 29 Mar 2017 02:20:07 +0000 (02:20 +0000)]
MFC r315201, r315920, r315921, r315922, r316008, and r316062.

r315201:
cxgbe(4):  Fix an always-true assertion (reported by PVS-Studio).

sys/dev/cxgbe/t4_main.c: PVS-Studio: Expression is Always True (CWE-571) (3)

r315920:
cxgbe/iw_cxgbe: c4iw_connect should always returns a -ve errno on failure.

r315921:

cxgbe/iw_cxgbe: alloc_ep expects a gfp_t, and it's always ok to sleep during
alloc_ep.

r315922:
cxgbe/iw_cxgbe: allocations that use GFP_KERNEL (which is M_WAITOK on
FreeBSD) cannot fail.

r316008:
cxgbe/iw_cxgbe: Remove unused code.

r316062:
cxgbe/iw_cxgbe: Defer the handling of error CQEs and RDMA_TERMINATE to
the thread that deals with socket state changes.  This eliminates
various bad races with the ithread.

7 years agoMFC r315280 r315287
vangyzen [Wed, 29 Mar 2017 01:21:48 +0000 (01:21 +0000)]
MFC r315280 r315287

When the RTC is adjusted, reevaluate absolute sleep times based on the RTC

POSIX 2008 says this about clock_settime(2):

    If the value of the CLOCK_REALTIME clock is set via clock_settime(),
    the new value of the clock shall be used to determine the time
    of expiration for absolute time services based upon the
    CLOCK_REALTIME clock.  This applies to the time at which armed
    absolute timers expire.  If the absolute time requested at the
    invocation of such a time service is before the new value of
    the clock, the time service shall expire immediately as if the
    clock had reached the requested time normally.

    Setting the value of the CLOCK_REALTIME clock via clock_settime()
    shall have no effect on threads that are blocked waiting for
    a relative time service based upon this clock, including the
    nanosleep() function; nor on the expiration of relative timers
    based upon this clock.  Consequently, these time services shall
    expire when the requested relative interval elapses, independently
    of the new or old value of the clock.

When the real-time clock is adjusted, such as by clock_settime(3),
wake any threads sleeping until an absolute real-clock time.
Such a sleep is indicated by a non-zero td_rtcgen.  The sleep functions
will set that field to zero and return zero to tell the caller
to reevaluate its sleep duration based on the new value of the clock.

At present, this affects the following functions:

    pthread_cond_timedwait(3)
    pthread_mutex_timedlock(3)
    pthread_rwlock_timedrdlock(3)
    pthread_rwlock_timedwrlock(3)
    sem_timedwait(3)
    sem_clockwait_np(3)

I'm working on adding clock_nanosleep(2), which will also be affected.

Reported by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Relnotes: yes
Sponsored by: Dell EMC

7 years agoMFC r315640
vangyzen [Tue, 28 Mar 2017 13:39:04 +0000 (13:39 +0000)]
MFC r315640

Port the getaddrinfo(1) utility from NetBSD.

PR: 183148
Submitted by: Lohith Bellad <lohithbsd@gmail.com>
Obtained from: NetBSD
Relnotes: yes
Sponsored by: Dell EMC

7 years agoMFC r315242: Fix late and noauto with geli swap
amdmi3 [Tue, 28 Mar 2017 10:43:19 +0000 (10:43 +0000)]
MFC r315242: Fix late and noauto with geli swap

With the following in /etc/fstab:

/dev/gpt/swap.eli none swap sw,late 0 0

swap will not be enabled, with `swapon -aL' complaining:

swapon: Invalid option: late

This happens because swap_on_geli_args() which parses geli arguments
out of all mount options does not expect late or noauto among them.
Fix this by explicitly allowing these arguments.

Reviewed by: jilles
Approved by: jilles
Differential Revision: D9835

7 years agoMFC r315279: Remove some dead/broken code paths around async handling
mav [Tue, 28 Mar 2017 10:25:56 +0000 (10:25 +0000)]
MFC r315279: Remove some dead/broken code paths around async handling

7 years agoMFC r315273: Remove tangled isp_mbox_continue() mechanism.
mav [Tue, 28 Mar 2017 10:24:41 +0000 (10:24 +0000)]
MFC r315273: Remove tangled isp_mbox_continue() mechanism.

It was implemented to reduce context switches when uploading firmware to
card's RAM.  But this mechanism is not used last 10 years since all mbox
operations are now polled, and it was never used for cards produced in
last 15 years.  Newer cards can use DMA to upload firmware.

7 years agoMFC r315236: Remove dangerous and questionable isp_mboxcmd_qnw() call.
mav [Tue, 28 Mar 2017 10:23:32 +0000 (10:23 +0000)]
MFC r315236: Remove dangerous and questionable isp_mboxcmd_qnw() call.

7 years agoMFC r315234: Improvements around attach, reset and detach.
mav [Tue, 28 Mar 2017 10:11:00 +0000 (10:11 +0000)]
MFC r315234: Improvements around attach, reset and detach.

This change fixes DMA resource leak on driver unload.  Also it removes
DMA resources allocation for hardcoded number of requests before fetching
the real number from firmware.  Also it prepares ground for more flexible
IRQs allocation according to firmware capabilities.

7 years agoMFC r313436,r313437,r313438,r314587,r315687:
ngie [Tue, 28 Mar 2017 06:13:21 +0000 (06:13 +0000)]
MFC r313436,r313437,r313438,r314587,r315687:

r313436:

Clarify #includes for hexdump(3) vs sbuf_hexdump(9)

hexdump(3) only requires libutil.h, whereas sbuf_hexdump(9) requires
sys/types.h (for ssize_t) and sys/sbuf.h

r313437:

Create link from hexdump(3) to sbuf_hexdump(9) as the manpage describes
sbuf_hexdump(9)'s behavior

r313438:

Clean up trailing and leading whitespace for variables to make it
consistent with the rest of the file and style.Makefile(9) a bit
more

r314587:

Correct MLINKS for sbuf_hexdump(9)

sbuf_hexdump(9) should be linked to sbuf(9), not hexdump(3). Another
review will be posted to deduplicate the sbuf_hexdump reference in
in hexdump(3) or at the very least make the information less duplicative.

r315687:

Document sbuf_hexdump(9) in just sbuf(9)

- Remove duplicate references to sbuf_hexdump(9) from hexdump(3).
  sbuf_hexdump(9) already pointed back to hexdump(3) for implementation
  details.
- Refer to sbuf_hexdump(9) instead of sbuf(9) for completeness

7 years agoMFC r315281:
kib [Tue, 28 Mar 2017 06:07:59 +0000 (06:07 +0000)]
MFC r315281:
Use atop() instead of OFF_TO_IDX() for convertion of addresses or
addresses offsets, as intended.

MFC r315580 (by alc):
Simplify the logic for clipping the range returned by the pager to fit
within the map entry.
Use atop() rather than OFF_TO_IDX() on addresses.

7 years agoMFC r315686,r315688:
ngie [Tue, 28 Mar 2017 06:03:43 +0000 (06:03 +0000)]
MFC r315686,r315688:

r315686:

kvm_geterr: handle `kd` == NULL in a deterministic/graceful manner

Return a NUL string instead of just working by accident with kvm_geterr(3)
when MALLOC_PRODUCTION is disabled (I didn't confirm the MALLOC_PRODUCTION
being enabled path).

Document the new explicit return behavior for kvm_geterr(3), as well
as the previous implicit behavior, i.e., the buffer attached to
returned via kvm_geterr(3) would be empty if a previous error hadn't been
stored in `kd`.

r315688:

kvm_write: fix -Wcast-qual warning in pointer arithmetic argument

Cast buf to `const char *` when doing arithmetic operation to match
`cp`'s type [1].

7 years agoMFC r315871: MFV r315791: ntp 4.2.8p10.
delphij [Tue, 28 Mar 2017 04:48:17 +0000 (04:48 +0000)]
MFC r315871: MFV r315791: ntp 4.2.8p10.

7 years agoMFC r315639:
ngie [Mon, 27 Mar 2017 18:31:00 +0000 (18:31 +0000)]
MFC r315639:

libcam: NULL out freed `ccb.cdm.matches` and `ccb.cdm.patterns` pointers

This is being done to avoid potential double frees with the values.

7 years agoMFC r314245:
ngie [Mon, 27 Mar 2017 18:28:15 +0000 (18:28 +0000)]
MFC r314245:

Fill MK_LIBTHR as far as lib/libthr is concerned

There are other areas of the tree that will need to be evaluated for sanity
if they're supposed to be conditionally compiled out of the build/install,
like libzpool

Relnotes: yes (this might break someone's system if have the knob set)

7 years agoMFC r315641,r315642:
ngie [Mon, 27 Mar 2017 18:26:19 +0000 (18:26 +0000)]
MFC r315641,r315642:

r315641:

bsnmp: don't leak snmp_client.fd in open_client_udp(..) on connect(2) failure

r315642:

bsnmp: explicitly test the return value for open_client_{local,udp} in snmp_open(..)

open_client_* returns -1 on failure; 0 on success. Ensure that the return value is
0 -- otherwise exit snmp_open(..).

7 years agoMFC r315690:
ngie [Mon, 27 Mar 2017 18:24:17 +0000 (18:24 +0000)]
MFC r315690:

Delete trailing whitespace (no functional change)

7 years agoMFC r315595,r315601,r315603,r315647:
ngie [Mon, 27 Mar 2017 18:22:33 +0000 (18:22 +0000)]
MFC r315595,r315601,r315603,r315647:

r315595:

Remove a commented out line before kvm_getprocs(3)

The commented out return value for kvm_getprocs(3) was misleading -- the
uncommented line is correct.

No content change

r315601:

kvm_open2(3): remove '*' when describing addr argument for `resolver`

As noted by vangyzen, with a similar issue in D10022, the pointer portion of
the .Fa macro call is unnecessary, so remove the '*'.

r315603:

kvm_close(3): return `error` instead of blindly returning `0`

`error` is the accumulated error from previous close(2) calls.

This bug has been present since the libcall's import from 4.4BSD
Lite (r1573).

Noticed by: vangyzen (D10022)
Relnotes: yes

r315647:

Handle kd == NULL gracefully with kvm_close(3)

Don't segfault in kvm_close(3) if provided a NULL pointer. Instead, return
-1 and set errno to EINVAL.

Document this new behavior explicitly.

7 years agoMFC 315229: Remove remnant of r315163.
mav [Mon, 27 Mar 2017 08:29:02 +0000 (08:29 +0000)]
MFC 315229: Remove remnant of r315163.

7 years agoMFC r315878:
kevlo [Mon, 27 Mar 2017 01:06:25 +0000 (01:06 +0000)]
MFC r315878:
Don't initialize if_output to ether_output(), ether_ifattach() does it for
us already.  While here, remove NOTYET code since if_watchdog is no longer
used.

Reviewed by: royger

7 years agoMFC 315529
kp [Sun, 26 Mar 2017 18:11:40 +0000 (18:11 +0000)]
MFC 315529

pf: Fix rule evaluation after inet6 route-to

In pf_route6() we re-run the ruleset with PF_FWD if the packet goes out
of a different interface. pf_test6() needs to know that the packet was
forwarded (in case it needs to refragment so it knows whether to call
ip6_output() or ip6_forward()).

This lead pf_test6() to try to evaluate rules against the PF_FWD
direction, which isn't supported, so it needs to treat PF_FWD as PF_OUT.
Once fwdir is set correctly the correct output/forward function will be
called.

PR:             217883
Submitted by:   Kajetan Staszkiewicz
Sponsored by:   InnoGames GmbH

7 years agoMFC r314942:
bapt [Sun, 26 Mar 2017 18:08:55 +0000 (18:08 +0000)]
MFC r314942:

Import the awk(1) manpage from OpenBSD

As discussed during AsiaBSDcon devsummit, import the manpage from OpenBSD which
is has been rewritten in mdoc(7) format making it readable by default with
mandoc, it also has been extended by OpenBSD to cover all awk(1) options

Obtained from: OpenBSD
MFC: 1 week

7 years agoMFC r314903:
bapt [Sun, 26 Mar 2017 18:07:59 +0000 (18:07 +0000)]
MFC r314903:

Remove reference to GNU info hier(7)
we have removed texinfo in FreeBSD 11.0

7 years agoMFC r314520:
bapt [Sun, 26 Mar 2017 18:06:22 +0000 (18:06 +0000)]
MFC r314520:

Import dma snapshot from git 2017-02-10

The only change is:
use basename to select executable identity

PR: 216910
Submitted by: Andrej Ebert <andrej@ebert.su>

7 years agoMFC r314902:
bapt [Sun, 26 Mar 2017 18:04:05 +0000 (18:04 +0000)]
MFC r314902:

texinfo is gone in r276551 remove the related directories

Reported by: jbeich

7 years agoMFC r315053-r315054, r315056
bapt [Sun, 26 Mar 2017 18:01:53 +0000 (18:01 +0000)]
MFC r315053-r315054, r315056

r315053:
Add share/man if it exists to the MANPATH

localbase is not consistent with base for manpages:
/usr/local/man vs /usr/share/man adding share/man allows to fix that
inconsistency and would permit to remove tons of patches/modifications in the
ports tree

r315054:
Extend functionality MANPATH in man(1) to followup with apropos(1) from
mandoc.

If MANPATH begins with a colon, it is appended to the default list; if it ends
with a colon, it is prepended to the default list; or if it contains two
adjacent colons, the standard search path is inserted between the colons.  If
none of these conditions are met, it overrides the standard search path.

Import the MANPATH description from mandoc into the man(1) man page

Reported by: kargl
MFC after: 1 week

r315056:
Remove the warning when MANPATH is set in the environment

The MANPATH environment variable behaviour is documented properly in the manpage
and it now has extended to new feature that allows to make MANPATH env variable
extending the default search path rather than overwriting it making the warning
painful

Reported by: kargl
MFC after: 1 week

7 years agoMFC r315571:
bapt [Sun, 26 Mar 2017 17:46:42 +0000 (17:46 +0000)]
MFC r315571:

Canada adheres to ISO 8601, let's make the locale reflecting that fact

PR: 200079
MFC after: 1 week
Submitted by: Dan McGregor <dan.mcgregor@usask.ca>
Reported by: A.J. Kehoe IV (Nanoman) <freebsd-bugs@nanoman.ca>
Differential Revision: https://reviews.freebsd.org/D9925

7 years agoMFC r315161: Try to slight untangle I/O and loop status handling.
mav [Sun, 26 Mar 2017 08:53:29 +0000 (08:53 +0000)]
MFC r315161: Try to slight untangle I/O and loop status handling.

7 years agoMFC r315160: Remove code for unsupported FreeBSD versions.
mav [Sun, 26 Mar 2017 08:52:14 +0000 (08:52 +0000)]
MFC r315160: Remove code for unsupported FreeBSD versions.

7 years agoMFC r315163: Remove strange config_intrhook_establish() magic.
mav [Sun, 26 Mar 2017 08:50:50 +0000 (08:50 +0000)]
MFC r315163: Remove strange config_intrhook_establish() magic.

Interrupts are enabled as part of chip reset just during driver attach.
Later "enabling" of already enabled interrupts is useless.

7 years agoMFC r315552:
kib [Sun, 26 Mar 2017 00:59:15 +0000 (00:59 +0000)]
MFC r315552:
Fix off-by-one in the vm_fault_populate() code.

7 years agoMFC r315588:
kib [Sun, 26 Mar 2017 00:56:24 +0000 (00:56 +0000)]
MFC r315588:
Update the list of cpudev ioctls which require write access.

7 years agoMFC r315586:
kib [Sun, 26 Mar 2017 00:53:34 +0000 (00:53 +0000)]
MFC r315586:
Style.

7 years agoMFC r315412, r314852:
badger [Sat, 25 Mar 2017 20:14:08 +0000 (20:14 +0000)]
MFC r315412, r314852:

r315412:
    Don't clear p_ptevents on normal SIGKILL delivery

    The ptrace() user has the option of discarding the signal. In such a
    case, p_ptevents should not be modified. If the ptrace() user decides to
    send a SIGKILL, ptevents will be cleared in ptracestop(). procfs events
    do not have the capability to discard the signal, so continue to clear
    the mask in that case.

r314852:
    don't stop in issignal() if P_SINGLE_EXIT is set

    Suppose a traced process is stopped in ptracestop() due to receipt of a
    SIGSTOP signal, and is awaiting orders from the tracing process on how
    to handle the signal. Before sending any such orders, the tracing
    process exits. This should kill the traced process. But suppose a second
    thread handles the SIGKILL and proceeds to exit1(), calling
    thread_single(). The first thread will now awaken and will have a chance
    to check once more if it should go to sleep due to the SIGSTOP.  It must
    not sleep after P_SINGLE_EXIT has been set; this would prevent the
    SIGKILL from taking effect, leaving a stopped orphan behind after the
    tracing process dies.

    Also add new tests for this condition.

Sponsored by: Dell EMC

7 years agoMFC r315499:
dchagin [Sat, 25 Mar 2017 14:28:20 +0000 (14:28 +0000)]
MFC r315499:

Remove superflous break statment.

7 years agoMFC r315503:
dchagin [Sat, 25 Mar 2017 14:26:45 +0000 (14:26 +0000)]
MFC r315503:

As noted by Roel Bouwman Linux allows a large buffer size than the
struct ucred size. Fix this.

PR:           102956

7 years agoMFC r315278:
dchagin [Sat, 25 Mar 2017 14:25:20 +0000 (14:25 +0000)]
MFC r315278:

Fix usage of the same 'i' variable in the external and nested loops.

7 years agoMFC r313992, r314075, r314118, r315484:
badger [Sat, 25 Mar 2017 13:33:23 +0000 (13:33 +0000)]
MFC r313992, r314075, r314118, r315484:

r315484:
    ptrace_test: eliminate assumption about thread scheduling

    A couple of the ptrace tests make assumptions about which thread in a
    multithreaded process will run after a halt. This makes the tests less
    portable across branches, and susceptible to future breakage. Instead,
    twiddle thread scheduling and priorities to match the tests'
    expectation.

r314118:
    Actually fix buildworlds other than i386/amd64/sparc64 after r313992

    Disable offending test for platforms without a userspace visible
    breakpoint().

r314075:
    Fix world build for archs where __builtin_debugtrap() does not work.

    The offending code was introduced in r313992.

r313992:
    Defer ptracestop() signals that cannot be delivered immediately

    When a thread is stopped in ptracestop(), the ptrace(2) user may request
    a signal be delivered upon resumption of the thread. Heretofore, those signals
    were discarded unless ptracestop()'s caller was issignal(). Fix this by
    modifying ptracestop() to queue up signals requested by the ptrace user that
    will be delivered when possible. Take special care when the signal is SIGKILL
    (usually generated from a PT_KILL request); no new stop events should be
    triggered after a PT_KILL.

    Add a number of tests for the new functionality. Several tests were authored
    by jhb.

PR: 212607
Sponsored by: Dell EMC

7 years agoMFC r315745:
dim [Sat, 25 Mar 2017 12:29:15 +0000 (12:29 +0000)]
MFC r315745:

Cherry-pick libcxxrt commit 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92:

Author: David Chisnall <theraven@FreeBSD.org>
Date:   Wed Mar 22 12:27:08 2017 +0000

    Simplify some code.

    realloc() with a null pointer is equivalent to malloc, so we don't need
    to handle the two cases independently.

    Fixes #46

This should help with lang/beignet and other programs, which expect
__cxa_demangle(name, NULL, NULL, &status) to return zero in status.

PR: 213732

7 years agoMFC r315689:
dim [Sat, 25 Mar 2017 12:21:20 +0000 (12:21 +0000)]
MFC r315689:

Gcc has incompatible internal declarations for __divtc3 and __multc3 as
defined in compiler-rt, but it has no option to silence its warning, so
make gcc warnings for libcompiler_rt non-fatal.

Noticed by: lwhsu

7 years agoMFC r315087, r315146:
mav [Sat, 25 Mar 2017 11:47:23 +0000 (11:47 +0000)]
MFC r315087, r315146:
Improve ctl(4) description, including frontends and backends.

7 years agoMFC r315084: Increase device openings to tagged maximum.
mav [Sat, 25 Mar 2017 11:44:34 +0000 (11:44 +0000)]
MFC r315084: Increase device openings to tagged maximum.

Some SIMs report much less untagged device openings then tagged ones.
Target mode devices are not handled by regular probing routines, and so
there is nothing to increase queue size for them to the SIM's maximum.
To fix that resize the queue explicitly on ctl periph registration.
This radically improves performance of mpt(4) in target mode.

Also fetch and report device queue statistics in `ctladm dumpstructs`,
since regular way of `camcontrol tags` is not usable in target mode.

7 years agoMFC r315082: Allow XPT_GDEV_STATS for UNCONFIGURED devices.
mav [Sat, 25 Mar 2017 11:35:31 +0000 (11:35 +0000)]
MFC r315082: Allow XPT_GDEV_STATS for UNCONFIGURED devices.

Queue statistics has nothing to do with presence or absence of INQUIRY
data, etc.  Target mode devices are never configured, but have queues.

7 years agoMFC r315716
grehan [Sat, 25 Mar 2017 05:41:34 +0000 (05:41 +0000)]
MFC r315716
  Bring the handling of the y axis in the ums driver in-line with the other
  axes.

  No functional change.

7 years agoMFC r315715 Fix a type in bhyve's USB mouse emulation.
grehan [Sat, 25 Mar 2017 05:21:49 +0000 (05:21 +0000)]
MFC r315715  Fix a type in bhyve's USB mouse emulation.

7 years agoMFC r315361 and r315364: Hide MONITORX/MWAITX from guests.
grehan [Sat, 25 Mar 2017 05:05:12 +0000 (05:05 +0000)]
MFC  r315361 and  r315364: Hide MONITORX/MWAITX from guests.

r315361
  Add the AMD MONITORX/MWAITX feature definition introduced in
  Bulldozer/Ryzen CPUs.

r315364
  Hide the AMD MONITORX/MWAITX capability.
  Otherwise, recent Linux guests will use these instructions, resulting
  in #UD exceptions since bhyve doesn't implement MONITOR/MWAIT exits.

  This fixes boot-time hangs in recent Linux guests on Ryzen CPUs
  (and probably Bulldozer aka AMD FX as well).

7 years agoMFC r315694
vangyzen [Sat, 25 Mar 2017 00:52:33 +0000 (00:52 +0000)]
MFC r315694

clock_gettime.2: add some clock IDs

Add the CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID clock_id
values to the clock_gettime(2) man page.  Reformat the excessively
long paragraph (sentence!) into a tag list.

Sponsored by: Dell EMC

7 years agoSubset of upstream r902 which fixes custom prompts.
des [Fri, 24 Mar 2017 14:39:00 +0000 (14:39 +0000)]
Subset of upstream r902 which fixes custom prompts.

PR: 216172

7 years agoMFH (r313974,r314596): open .netrc early in case we want to drop privs
des [Fri, 24 Mar 2017 14:19:52 +0000 (14:19 +0000)]
MFH (r313974,r314596): open .netrc early in case we want to drop privs
MFH (r314396,r315143): fix a crash caused by an incorrect format string
MFH (r314701): fix handling of 416 errors when requesting a range
MFH (r315455): fix parsing of IP literals (square brackets)

PR: 212065, 217723

7 years agoMFC r305383:
mjg [Fri, 24 Mar 2017 08:06:00 +0000 (08:06 +0000)]
MFC r305383:

fd: fix up fdeget_file

It was supposed to return NULL if a fp is not installed.

7 years agoMFC r315453:
kib [Fri, 24 Mar 2017 07:14:46 +0000 (07:14 +0000)]
MFC r315453:
When clearing altsigstack settings on exec, do it to the right thread.

7 years agoMFC r315022: Request change of SIM target role only when it is different.
mav [Fri, 24 Mar 2017 07:02:51 +0000 (07:02 +0000)]
MFC r315022: Request change of SIM target role only when it is different.

Separate WWNs change into separate request to know what actually failed.

7 years agoMFC r315030: Abort all ATIOs and INOTs queued to SIM on LUN disable.
mav [Fri, 24 Mar 2017 07:01:31 +0000 (07:01 +0000)]
MFC r315030: Abort all ATIOs and INOTs queued to SIM on LUN disable.

Some SIMs may not abort them implicitly, that either fail the LUN disable
request or just make us wait for those CCBs forever.  With this change
I can successfully disable LUNs on mpt(4).  For isp(4), which aborts them
implicitly, this change should be irrelevant.

7 years agoMFC r315025: Switch work_queue from TAILQ to STAILQ.
mav [Fri, 24 Mar 2017 06:59:40 +0000 (06:59 +0000)]
MFC r315025: Switch work_queue from TAILQ to STAILQ.

It is mostly FIFO and we don't need random removal there.

7 years agoMFC r314365
davidcs [Fri, 24 Mar 2017 02:58:20 +0000 (02:58 +0000)]
MFC r314365
1. state checks in bxe_tx_mq_start_locked() and bxe_tx_mq_start() to
   sync threads during interface down or detach.
2. add sysctl to set pause frame parameters
3. increase max segs for TSO packets to BXE_TSO_MAX_SEGMENTS (32)
4. add debug messages for PHY
5. HW LRO support restricted to FreeBSD versions 8.x and above.

Submitted by: Vaishali.Kulkarni@cavium.com

7 years agoMFC r312932,r312933,r312949,r313141
mjg [Thu, 23 Mar 2017 22:22:24 +0000 (22:22 +0000)]
MFC r312932,r312933,r312949,r313141

(by cognet)

Use strexeq instead of needlessly branch.

==

(by cognet)

Remove useless labels.

==

(by cognet)

Correct the IT instruction in atomic_fcmpset_64().

==

(by andrew)

Only define atomic_fcmpset_long in the kernel. We may include
machine/atomic.h in userspace, however atomic_fcmpset_32 is unimplemented
there.

7 years agoMFC r314814 and r315325.
np [Thu, 23 Mar 2017 17:11:34 +0000 (17:11 +0000)]
MFC r314814 and r315325.

r314814:
cxgbe/iw_cxgbe: Abort connection if there is an error during c4iw_modify_qp.

r315325:
cxgbe/iw_cxgbe: Use the socket and not the toepcb to reach for the
inpcb.  t4_tom detaches the inpcb from the toepcb as soon as the
hardware is done with the connection (in final_cpl_received) but the
socket is around as long as the cm_id and the rest of iWARP state is.

This fixes an intermittent NULL dereference during abort.

7 years agoMFC r315423:
smh [Thu, 23 Mar 2017 10:43:29 +0000 (10:43 +0000)]
MFC r315423:

Fix libsysdecode vmprot flag decoding

Sponsored by: Multiplay

7 years agoMFC r315076: zfs: provide a special vptocnp method for the .zfs vnode
avg [Thu, 23 Mar 2017 08:22:27 +0000 (08:22 +0000)]
MFC r315076: zfs: provide a special vptocnp method for the .zfs vnode

7 years agoadd UPDATING entry for r315842, MFC of re-worked .zfs code
avg [Thu, 23 Mar 2017 08:19:31 +0000 (08:19 +0000)]
add UPDATING entry for r315842, MFC of re-worked .zfs code

7 years agoMFC r314048,r314194: reimplement zfsctl (.zfs) support
avg [Thu, 23 Mar 2017 08:14:41 +0000 (08:14 +0000)]
MFC r314048,r314194: reimplement zfsctl (.zfs) support

7 years agoMFC r315083: aacraid: fix build with AACRAID_DEBUG=2
avg [Thu, 23 Mar 2017 08:10:25 +0000 (08:10 +0000)]
MFC r315083: aacraid: fix build with AACRAID_DEBUG=2

7 years agoMFC r315075: trace thread running state when a thread is run for the first time
avg [Thu, 23 Mar 2017 08:08:34 +0000 (08:08 +0000)]
MFC r315075: trace thread running state when a thread is run for the first time

7 years agoMFC r315074: actually implement proc:::lwp-exit probe
avg [Thu, 23 Mar 2017 08:02:23 +0000 (08:02 +0000)]
MFC r315074: actually implement proc:::lwp-exit probe

7 years agoMFC r314913: MFV r314911: 7867 ARC space accounting leak
avg [Thu, 23 Mar 2017 08:00:16 +0000 (08:00 +0000)]
MFC r314913: MFV r314911: 7867 ARC space accounting leak

7 years agoMFC r314912: MFV r314910: 7843 get_clones_stat() is suboptimal for lots of clones
avg [Thu, 23 Mar 2017 07:57:37 +0000 (07:57 +0000)]
MFC r314912: MFV r314910: 7843 get_clones_stat() is suboptimal for lots of clones

7 years agoMFC r314864: firewire/sbp: try to improve locking, plus a few style nits
avg [Thu, 23 Mar 2017 07:56:07 +0000 (07:56 +0000)]
MFC r314864: firewire/sbp: try to improve locking, plus a few style nits

7 years agoMFC r315067: Partially fix target task management requests handling.
mav [Thu, 23 Mar 2017 06:53:31 +0000 (06:53 +0000)]
MFC r315067: Partially fix target task management requests handling.

 - XPT_NOTIFY_ACKNOWLEDGE was not handled, causing stuck requests.
 - XPT_ABORT was not even trying to abort active ATIOs/INOTs.
 - Initiator's tag was not stored and not used where needed.
 - List of TM request types needed update.
 - mpt_scsi_tgt_status() missed some useful debugging.

After this change global TM requests, such as reset, should work properly.
ABORT TASK (ABTS) requests are still not passes to CTL, that is not good
and should be fixed.

7 years agoMFC r315004: Add PIM_EXTLUNS support to mpt(4).
mav [Thu, 23 Mar 2017 06:51:53 +0000 (06:51 +0000)]
MFC r315004: Add PIM_EXTLUNS support to mpt(4).

Target mode is still limited to 256 LUNs due to the way driver is written,
but initiator can now use full 8 byte LUN space.

7 years agoMFC r315002: Improve residuals reporting in target mode.
mav [Thu, 23 Mar 2017 06:50:13 +0000 (06:50 +0000)]
MFC r315002: Improve residuals reporting in target mode.

7 years agoMFC r315001: Fix panic on wildcard target LUN disable.
mav [Thu, 23 Mar 2017 06:49:36 +0000 (06:49 +0000)]
MFC r315001: Fix panic on wildcard target LUN disable.

7 years agoMFC r314998: Fix FC target mode in mpt(4), broken in multiple ways.
mav [Thu, 23 Mar 2017 06:48:31 +0000 (06:48 +0000)]
MFC r314998: Fix FC target mode in mpt(4), broken in multiple ways.

 - Not set BufferLength caused receive of empty ATIOs.
 - CDB length guessing was broken at least for RC16.
 - mpt_req_untimeout() was called with wrong req parameter.
 - Sense data reporting was broken in several ways.

With this change my LSI7204EP-LC can pass at least basic tests as target.
The code is still far from perfect, but finally I found second hw/driver
after isp(4) that really can work in CAM target mode.

7 years agoMFC r314967: Add support for XPT_GET_SIM_KNOB in FC mode.
mav [Thu, 23 Mar 2017 06:47:08 +0000 (06:47 +0000)]
MFC r314967: Add support for XPT_GET_SIM_KNOB in FC mode.

7 years agoMFC r314968: Report some more data in XPT_PATH_INQ.
mav [Thu, 23 Mar 2017 06:45:11 +0000 (06:45 +0000)]
MFC r314968: Report some more data in XPT_PATH_INQ.

I am not sure they are used anywhere, but why not.

7 years agoMFC r314966: Report FC link speed.
mav [Thu, 23 Mar 2017 06:41:58 +0000 (06:41 +0000)]
MFC r314966: Report FC link speed.

7 years agoMFC r311305 (by asomers):
mav [Thu, 23 Mar 2017 06:40:20 +0000 (06:40 +0000)]
MFC r311305 (by asomers):
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)

The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR: 215474
Reported by:    Coverity
CID:            1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID:            1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID:            1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID:            1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID:            1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID:            1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID:            1010035 1010036 1010042 1010041 1010040 1010039

7 years agoMFC r308423 (by scottl):
mav [Thu, 23 Mar 2017 06:36:55 +0000 (06:36 +0000)]
MFC r308423 (by scottl):
Fix the fallout from r308268 (mpt driver causes endless witness warnings in
VMWare and elsewhere) with the precision of a dull, rusty butter knife.