]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoRevert: r334016
Marcelo Araujo [Tue, 22 May 2018 06:02:11 +0000 (06:02 +0000)]
Revert: r334016
Revert for now this change, it in somehow breaks init_pci.

6 years agopmc: annotate locking for po_ssnext in pmc_owner
Matt Macy [Tue, 22 May 2018 05:49:40 +0000 (05:49 +0000)]
pmc: annotate locking for po_ssnext in pmc_owner

6 years agoInclude atkbdc header where there are declared the prototype functions
Marcelo Araujo [Tue, 22 May 2018 05:21:53 +0000 (05:21 +0000)]
Include atkbdc header where there are declared the prototype functions
atkbdc_event and atkbdc_init.

MFC after: 4 weeks.
Sponsored by: iXsystems Inc.

6 years agofix i386 builds after r334005 and r334009
Matt Macy [Tue, 22 May 2018 05:09:33 +0000 (05:09 +0000)]
fix i386 builds after r334005 and r334009

r334005: add pc_ibpb_set as it is now referenced by common code
(although presumably not needed on i386 since it has been there
since the first spectre mitigation work on amd64)

r334009: there is no amd64 rflags -> i386 eflags

6 years agopmcstat: add option to not decode the leaf function in top mode
Matt Macy [Tue, 22 May 2018 04:45:46 +0000 (04:45 +0000)]
pmcstat: add option to not decode the leaf function in top mode

-I will allow the user to see the hot instruction in question
as opposed getting the name of the function

6 years agoWe must free the variable str.
Marcelo Araujo [Tue, 22 May 2018 04:08:08 +0000 (04:08 +0000)]
We must free the variable str.

Spotted by: clang's static analyzer
Submitted by: Tom Rix <trix_juniper.net>
Reviewed by: grehan
MFC after: 4 weeks
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D10009

6 years agoAdd an IPMI attachment for PowerNV systems
Justin Hibbits [Tue, 22 May 2018 03:57:32 +0000 (03:57 +0000)]
Add an IPMI attachment for PowerNV systems

IPMI access on PowerNV systems is done through the OPAL firmware.  This adds a
simple attachment for communicating with the FSP/BMC on these machines.  This
has been tested on a Talos POWER9 workstation, only in the bootup phase, noting
the successful attachment messages:

...
ipmi0: IPMI device rev. 0, firmware rev. 2.00, version 2.0, device support mask 0
ipmi0: Number of channels 2
...

The ipmi device has not been added to GENERIC64, but may be after further
testing.  It may also eventually be added to the ipmi module at that point.

6 years agoAdd a comment explaining the need of a global temporary variable
Justin Hibbits [Tue, 22 May 2018 03:24:16 +0000 (03:24 +0000)]
Add a comment explaining the need of a global temporary variable

cpu_xirr is used only as a temporary location for the OPAL call in
PIC_DISPATCH().

Requested by: nwhitehorn

6 years agoBasic OPAL sensor support for POWER9 platforms
Justin Hibbits [Tue, 22 May 2018 02:42:53 +0000 (02:42 +0000)]
Basic OPAL sensor support for POWER9 platforms

Summary:
PowerNV architectures (in the test case POWER9) export sensors via the device
tree, which are accessed via OPAL calls.  This adds sysctl nodes for each
device in a generic fashion.  New sysctl nodes are:

dev.opal_sensor.N.sensor
dev.opal_sensor.N.sensor_min
dev.opal_sensor.N.sensor_max
dev.opal_sensor.N.type
dev.opal_sensor.N.label

These are rooted at a parent attachment under opal, called opalsens.  This does
not add support for the "sensor groups" defined in the device tree.

Reviewed by: breno.leitao_gmail.com
Differential Revision: https://reviews.freebsd.org/D15362

6 years agotop(1): unbreak build with gcc7; fix varargs
Eitan Adler [Tue, 22 May 2018 02:13:04 +0000 (02:13 +0000)]
top(1): unbreak build with gcc7; fix varargs

- use correct function for varargs argument
- allow build to complete with gcc7 at current WARNS

Reported by: jhibbits, ian

6 years agoCleanups related to debug exceptions on x86.
John Baldwin [Tue, 22 May 2018 00:45:00 +0000 (00:45 +0000)]
Cleanups related to debug exceptions on x86.

- Add constants for fields in DR6 and the reserved fields in DR7.  Use
  these constants instead of magic numbers in most places that use DR6
  and DR7.
- Refer to T_TRCTRAP as "debug exception" rather than a "trace trap"
  as it is not just for trace exceptions.
- Always read DR6 for debug exceptions and only clear TF in the flags
  register for user exceptions where DR6.BS is set.
- Clear DR6 before returning from a debug exception handler as
  recommended by the SDM dating all the way back to the 386.  This
  allows debuggers to determine the cause of each exception.  For
  kernel traps, clear DR6 in the T_TRCTRAP case and pass DR6 by value
  to other parts of the handler (namely, user_dbreg_trap()).  For user
  traps, wait until after trapsignal to clear DR6 so that userland
  debuggers can read DR6 via PT_GETDBREGS while the thread is stopped
  in trapsignal().

Reviewed by: kib, rgrimes
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D15189

6 years agosh: Split CNL syntax category to avoid a check on state[level].syntax
Jilles Tjoelker [Mon, 21 May 2018 21:52:48 +0000 (21:52 +0000)]
sh: Split CNL syntax category to avoid a check on state[level].syntax

No functional change is intended.

6 years agodevd: Always install devmatch.conf
Emmanuel Vadot [Mon, 21 May 2018 21:44:47 +0000 (21:44 +0000)]
devd: Always install devmatch.conf

It allows devd to run devmatch to find the correct driver based on pnp info.

No Objection from:    imp

6 years agoaw_mmc: Correctly reset the mmc controller
Emmanuel Vadot [Mon, 21 May 2018 21:15:46 +0000 (21:15 +0000)]
aw_mmc: Correctly reset the mmc controller

Always disable FIFO access as we don't use it.
Rename some register bits so they are in sync with the register name.

While here add my copyright as I've probably wrote 70% of the code here.

6 years agoAdd Intel Spec Store Bypass Disable control.
Konstantin Belousov [Mon, 21 May 2018 21:08:19 +0000 (21:08 +0000)]
Add Intel Spec Store Bypass Disable control.

Speculative Store Bypass (SSB) is a speculative execution side channel
vulnerability identified by Jann Horn of Google Project Zero (GPZ) and
Ken Johnson of the Microsoft Security Response Center (MSRC)
https://bugs.chromium.org/p/project-zero/issues/detail?id=1528.
Updated Intel microcode introduces a MSR bit to disable SSB as a
mitigation for the vulnerability.

Introduce a sysctl hw.spec_store_bypass_disable to provide global
control over the SSBD bit, akin to the existing sysctl that controls
IBRS. The sysctl can be set to one of three values:
0: off
1: on
2: auto

Future work will enable applications to control SSBD on a per-process
basis (when it is not enabled globally).

SSBD bit detection and control was verified with prerelease microcode.

Security: CVE-2018-3639
Tested by: emaste (previous version, without updated microcode)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agoAdd definition for Intel Speculative Store Bypass Disable MSR bits
Konstantin Belousov [Mon, 21 May 2018 21:07:13 +0000 (21:07 +0000)]
Add definition for Intel Speculative Store Bypass Disable MSR bits

Security: CVE-2018-3639
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agoPreserve other bits in IA32_SPEC_CTL MSR when changing the IBRS and
Konstantin Belousov [Mon, 21 May 2018 21:05:55 +0000 (21:05 +0000)]
Preserve other bits in IA32_SPEC_CTL MSR when changing the IBRS and
STIBP states.

Tested by: emaste (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agouchcom: extend hardware support to version 0x30
Andriy Gapon [Mon, 21 May 2018 21:04:31 +0000 (21:04 +0000)]
uchcom: extend hardware support to version 0x30

This change adds support for a UBS<->RS232 adapter based on CH340 (or an
analogue) that I own.  The device seems to have a newer internal version
(0x30) and the existing code incorrectly configures line control for it
resulting in garbled transmission.  The changes are based on what I
learned in Linux drivers for the same hardware.

Additional changes:
- use UCHCOM_REG_LCR1 / UCHCOM_REG_LCR2 instead of explicit 0x18 and
  0x25
- use NULL instead of 0 where a pointer is expected

Reviewed by: hselasky
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15498

6 years agouchcom: remove UCHCOM_REG_BREAK2 alias of UCHCOM_REG_LCR1
Andriy Gapon [Mon, 21 May 2018 21:02:10 +0000 (21:02 +0000)]
uchcom: remove UCHCOM_REG_BREAK2 alias of UCHCOM_REG_LCR1

Also, add definitions for more bits of UCHCOM_REG_LCR1 as seen in the
Linux driver.  UCHCOM_LCR1_PARENB definition was different from that in
the Linux driver and clashed with newly added UCHCOM_LCR1_RX.  I took a
liberty to change UCHCOM_LCR1_PARENB to the Linux definition as it was
unused in the driver anyway.  This change should make
uchcom_cfg_set_break() easier to understand.

Approved by: hselasky
MFC after: 2 weeks

6 years agouchcom: reject parity and double stop bits as unsupported
Andriy Gapon [Mon, 21 May 2018 21:00:13 +0000 (21:00 +0000)]
uchcom: reject parity and double stop bits as unsupported

Reviewed by: hselasky
MFC after: 2 weeks

6 years agouchcom: add a hardware configuration tweak seen in Linux code
Andriy Gapon [Mon, 21 May 2018 20:59:15 +0000 (20:59 +0000)]
uchcom: add a hardware configuration tweak seen in Linux code

Reviewed by: hselasky
MFC after: 2 weeks

6 years agouchcom: add DPRINTF-s to aid debugging of the driver
Andriy Gapon [Mon, 21 May 2018 20:58:06 +0000 (20:58 +0000)]
uchcom: add DPRINTF-s to aid debugging of the driver

Reviewed by: hselasky
MFC after: 2 weeks

6 years agouchcom: report detected product based on USB product ID
Andriy Gapon [Mon, 21 May 2018 20:57:14 +0000 (20:57 +0000)]
uchcom: report detected product based on USB product ID

Product IDs are specified in vendor documents.  The previously used
device ID is not.  This is a cosmetic change.  No functionality depends
on those IDs.

Reviewed by: hselasky
MFC after: 2 weeks

6 years agoteken: Rename the "Set Cursor Style" sequence to match vt100.net docs
Jean-Sébastien Pédron [Mon, 21 May 2018 20:35:16 +0000 (20:35 +0000)]
teken: Rename the "Set Cursor Style" sequence to match vt100.net docs

This fixes inconsistencies with the rest of the `sequences` file.

No functional changes.

Requested by: ed

6 years agostop and restart kernel event timers in the suspend / resume cycle
Andriy Gapon [Mon, 21 May 2018 20:23:04 +0000 (20:23 +0000)]
stop and restart kernel event timers in the suspend / resume cycle

I have a system that is very unstable after resuming from suspend-to-RAM
but only if HPET is used as the event timer.  The theory is that SMM
code / firmware could be enabling HPET for its own uses and unexpected
interrupts cause a trouble for it.  Originally I wanted to solve the
problem in hpet_suspend() method, but that was insufficient as the event
timer could get reprogrammed again.

So, it's better, for my case and in general, to stop the event timer(s)
before entering the hardware suspend.

MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D15413

6 years agoFix grammar.
Konstantin Belousov [Mon, 21 May 2018 19:15:05 +0000 (19:15 +0000)]
Fix grammar.

Submitted by: alc
MFC after: 1 week

6 years agoAdd missed barrier for pm_gen/pm_active interaction.
Konstantin Belousov [Mon, 21 May 2018 18:41:16 +0000 (18:41 +0000)]
Add missed barrier for pm_gen/pm_active interaction.

When we issue shootdown IPIs, we first assign zero to pm_gens to
indicate the need to flush on the next context switch in case our IPI
misses the context, next we read pm_active. On context switch we set
our bit in pm_active, then we read pm_gen. It is crucial that both
threads see the memory in the program order, otherwise invalidation
thread might read pm_active bit as zero and the context switching
thread might read pm_gen as zero.

IA32 allows CPU for both reads to see zero. We must use the barriers
between write and read. The pm_active bit set is already locked, so
only the invalidation functions need it.

I never saw it in real life, or at least I do not have a good
reproduction case. I found this during code inspection when hunting
for the Xen TLB issue reported by cperciva.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D15506

6 years agoAdd a somewhat ugly hack that makes OSX serial device node names
Edward Tomasz Napierala [Mon, 21 May 2018 17:33:52 +0000 (17:33 +0000)]
Add a somewhat ugly hack that makes OSX serial device node names
human-readable.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoFix typo.
Edward Tomasz Napierala [Mon, 21 May 2018 16:50:27 +0000 (16:50 +0000)]
Fix typo.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoImprove description strings for USB device-mode serial ports.
Edward Tomasz Napierala [Mon, 21 May 2018 16:33:13 +0000 (16:33 +0000)]
Improve description strings for USB device-mode serial ports.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoRemove check for matching the rulenum, ruleid and rule pointer from
Andrey V. Elsukov [Mon, 21 May 2018 16:19:00 +0000 (16:19 +0000)]
Remove check for matching the rulenum, ruleid and rule pointer from
dyn_lookup_ipv[46]_state_locked(). These checks are remnants of not
ready to be committed code, and they are there by accident.
Due to the race these checks can lead to creating of duplicate states
when concurrent threads in the same time will try to add state for two
packets of the same flow, but in reverse directions and matched by
different parent rules.

Reported by: lev
MFC after: 3 days

6 years agoRestrict the faulting addresses we call pmap_fault from to just those that
Andrew Turner [Mon, 21 May 2018 16:14:53 +0000 (16:14 +0000)]
Restrict the faulting addresses we call pmap_fault from to just those that
may fault due to superpage mappings being changed.

Sponsored by: DARPA, AFRL

6 years agoinpcb: revert deferred inpcb free pending further review
Matt Macy [Mon, 21 May 2018 16:13:43 +0000 (16:13 +0000)]
inpcb: revert deferred inpcb free pending further review

6 years agoDon't pass a section cookie to CK for non-preemptible epoch sections.
Mark Johnston [Mon, 21 May 2018 16:03:51 +0000 (16:03 +0000)]
Don't pass a section cookie to CK for non-preemptible epoch sections.

They're only useful when multiple threads may share an epoch record,
and that can't happen with non-preemptible sections.

Reviewed by: mmacy
Differential Revision: https://reviews.freebsd.org/D15507

6 years agoUse USB Vendor Identifiers and Product Identifiers provided by V-USB
Edward Tomasz Napierala [Mon, 21 May 2018 15:06:19 +0000 (15:06 +0000)]
Use USB Vendor Identifiers and Product Identifiers provided by V-USB
(https://github.com/obdev/v-usb/blob/master/usbdrv/USB-IDs-for-free.txt).
Previously we were using an invalid (not assigned to us) VID.

Reviewed by: hselasky@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoOnly fillin data srucuture when actually stored.
Michael Tuexen [Mon, 21 May 2018 14:53:22 +0000 (14:53 +0000)]
Only fillin data srucuture when actually stored.

6 years agoDo the appropriate accounting when ip_output() fails.
Michael Tuexen [Mon, 21 May 2018 14:52:18 +0000 (14:52 +0000)]
Do the appropriate accounting when ip_output() fails.

6 years agoMake clear why there is an assignment, which is not necessary.
Michael Tuexen [Mon, 21 May 2018 14:51:20 +0000 (14:51 +0000)]
Make clear why there is an assignment, which is not necessary.

6 years agoPair CURVNET_SET and CURVNET_RESTORE in a block
Ed Maste [Mon, 21 May 2018 13:08:44 +0000 (13:08 +0000)]
Pair CURVNET_SET and CURVNET_RESTORE in a block

Per vnet(9), CURVNET_SET and CURVNET_RESTORE cannot be used as a single
statement for a conditional and CURVNET_RESTORE must be in the same
block as CURVNET_SET (or a subblock).

Reviewed by: andrew
Sponsored by: The FreeBSD Foundation

6 years agorelease: arm64: Use loader.efi as bootaa64.efi for RPI3 and PINE64
Emmanuel Vadot [Mon, 21 May 2018 11:58:02 +0000 (11:58 +0000)]
release: arm64: Use loader.efi as bootaa64.efi for RPI3 and PINE64

boot1.efi have some trouble to read MBR partitions, it needs them to be
aligned a certain way while loader.efi can cope with them either way.
We want to switch to loader.efi as the main efi loader everywhere, it seems
that arm64 using MBR partition will be the guinea pig.

Tested On: RPI3, Pine64
Reviewed by: imp
Approved by: gjb

6 years agoRevert r333968, it broke all archs but i386 and amd64
Ed Maste [Mon, 21 May 2018 11:56:07 +0000 (11:56 +0000)]
Revert r333968, it broke all archs but i386 and amd64

6 years agotop(1): fix build
Eitan Adler [Mon, 21 May 2018 09:43:50 +0000 (09:43 +0000)]
top(1): fix build

Remove 'top.local.hs'. This was not noticed since
/srv/obj/fbsd/srv/src/freebsd/svn/head/amd64.amd64/usr.bin/top/top.local.h
existed locally on my machine despite "make clean". Only fully removing
the objdir allowed me to observe the error directly.

Pointyhat to: me

6 years agotop(1): clean up some "const" related warnings
Eitan Adler [Mon, 21 May 2018 09:32:52 +0000 (09:32 +0000)]
top(1): clean up some "const" related warnings

This leaves at WARNS=6:
35 warnings in top.c
88 warnings in machine.c

all of which are either "incompatible-pointer-types-discards-qualifiers"
or "cast-qual"

6 years agotop(1): modernize a bit; reduce warnings
Eitan Adler [Mon, 21 May 2018 09:25:21 +0000 (09:25 +0000)]
top(1): modernize a bit; reduce warnings

- Replace caddr_t with "void *". This reduces
the number of warnings at WARNS=6
- use "static" where possible
- sprinkle const where possible

This leaves at WARNS=6:
35 warnings in top.c
88 warnings in machine.c
7 warnings in commands.c

all of which are either "incompatible-pointer-types-discards-qualifiers"
or "cast-qual"

6 years agoAdd missing va_end
Eitan Adler [Mon, 21 May 2018 09:21:42 +0000 (09:21 +0000)]
Add missing va_end

Reported by: andrew

6 years agoRevert r333969 which contained one too many changes
Eitan Adler [Mon, 21 May 2018 09:20:26 +0000 (09:20 +0000)]
Revert r333969 which contained one too many changes

6 years agotop(1): modernize a bit; reduce warnings
Eitan Adler [Mon, 21 May 2018 09:18:01 +0000 (09:18 +0000)]
top(1): modernize a bit; reduce warnings

- Replace caddr_t with "void *". This reduces
the number of warnings at WARNS=6
- use "static" where possible
- sprinkle const where possible

This leaves at WARNS=6:
35 warnings in top.c
72 warnings in machine.c
5 warnings in commands.c

all of which are either "incompatible-pointer-types-discards-qualifiers"
or "cast-qual"

6 years agoin(6)_mcast: Expand out vnet set / restore macro so that they work in a conditional...
Matt Macy [Mon, 21 May 2018 08:34:10 +0000 (08:34 +0000)]
in(6)_mcast: Expand out vnet set / restore macro so that they work in a conditional block

Reported by: zec at fer.hr

6 years agoensure that vnet is set when doing in_leavegroup
Matt Macy [Mon, 21 May 2018 07:12:06 +0000 (07:12 +0000)]
ensure that vnet is set when doing in_leavegroup

6 years agoamd64: annotate pti with __read_frequently
Mateusz Guzik [Mon, 21 May 2018 05:20:23 +0000 (05:20 +0000)]
amd64: annotate pti with __read_frequently

6 years agotop(1): add myself as a MAINTAIENR
Eitan Adler [Mon, 21 May 2018 05:00:19 +0000 (05:00 +0000)]
top(1): add myself as a MAINTAIENR

also fix some nits

6 years agotop(1): remove prime.c
Eitan Adler [Mon, 21 May 2018 04:51:43 +0000 (04:51 +0000)]
top(1): remove prime.c

This file was not connected to the build, and is better served by
primes(6) anyways.

6 years agotop(1): fix MIPS
Eitan Adler [Mon, 21 May 2018 04:47:13 +0000 (04:47 +0000)]
top(1): fix MIPS

I missed where the parentheses were.

Reported by: imp

6 years agotop(1): further unconditionally assume we're on FreeBSD
Eitan Adler [Mon, 21 May 2018 04:40:20 +0000 (04:40 +0000)]
top(1): further unconditionally assume we're on FreeBSD

6 years agotop(1): clean up in prep for const poisoning
Eitan Adler [Mon, 21 May 2018 04:32:14 +0000 (04:32 +0000)]
top(1): clean up in prep for const poisoning

- sprinkle "const" in a few obvious places
- remove "(void)" in front of lack-of-error-checked functions

6 years agotop(1): further unconditionally assume we're on FreeBSD
Eitan Adler [Mon, 21 May 2018 04:02:45 +0000 (04:02 +0000)]
top(1): further unconditionally assume we're on FreeBSD

6 years agotop(1): build with WARNS=3
Eitan Adler [Mon, 21 May 2018 03:58:15 +0000 (03:58 +0000)]
top(1): build with WARNS=3

This fixes everything but
-Wincompatible-pointer-types-discards-qualifiers

6 years agotop(1): fix several more warnings
Eitan Adler [Mon, 21 May 2018 03:36:16 +0000 (03:36 +0000)]
top(1): fix several more warnings

6 years agock: simplify interface with libkvm consumers by defining ck_queue types
Matt Macy [Mon, 21 May 2018 01:53:23 +0000 (01:53 +0000)]
ck: simplify interface with libkvm consumers by defining ck_queue types
as their queue.h equivalents if !_KERNEL

6 years agotop(1): fix build on arches where size_t != ull
Eitan Adler [Mon, 21 May 2018 01:39:26 +0000 (01:39 +0000)]
top(1): fix build on arches where size_t != ull

6 years ago- Unbreak booting sparc64 kernels after the metadata unification in
Marius Strobl [Mon, 21 May 2018 01:20:19 +0000 (01:20 +0000)]
- Unbreak booting sparc64 kernels after the metadata unification in
  r329190; sparc64 kernels are always 64-bit but with that revision
  in place, the loader was treating them as 32-bit ones.
- In order to reduce the likelihood of this kind of breakage in the
  future, #ifdef out md_load() on sparc64 and make md_load_dual() -
  which is currently local to metadata.c anyway - static.
- Make md_getboothowto() - also local to metadata.c - static.
- Get rid of the unused DTB pointer on sparc64.

6 years agotop(1): pull function declarations and externs into headers
Eitan Adler [Mon, 21 May 2018 01:16:26 +0000 (01:16 +0000)]
top(1): pull function declarations and externs into headers

6 years agotop(1): fix "variable without declaration" warning
Eitan Adler [Mon, 21 May 2018 01:05:32 +0000 (01:05 +0000)]
top(1): fix "variable without declaration" warning

This is only shown at WARNS=6, but since we don't yet build at WARNS=2
its hidden.

6 years agotop(1): clean much of WARNS=3 issues
Eitan Adler [Mon, 21 May 2018 00:53:42 +0000 (00:53 +0000)]
top(1): clean much of WARNS=3 issues

There is still one glaring issue: new_message is not a protoype, but
can't be trivially converted since it uses K&R style var-args.

6 years agotop(1): build with WARN=2
Eitan Adler [Mon, 21 May 2018 00:32:48 +0000 (00:32 +0000)]
top(1): build with WARN=2

6 years agotop(1): add getrusage to SEE also
Eitan Adler [Mon, 21 May 2018 00:20:32 +0000 (00:20 +0000)]
top(1): add getrusage to SEE also

This documents the various columns that top might support.

PR: 199637
Submitted by: vermaden@interia.pl

6 years agotop(1): Remove now-unused variable
Eitan Adler [Sun, 20 May 2018 23:39:08 +0000 (23:39 +0000)]
top(1): Remove now-unused variable

6 years agotop(1): pull configuration directly into header files
Eitan Adler [Sun, 20 May 2018 23:37:30 +0000 (23:37 +0000)]
top(1): pull configuration directly into header files

This sets configuration variables directly in the various header files,
avoiding the need to have special logic in our Makefile to build the
header.

6 years agotop(1): set max username length based on system constant
Eitan Adler [Sun, 20 May 2018 23:19:09 +0000 (23:19 +0000)]
top(1): set max username length based on system constant

This changes previous behavior of calculating it at startup based on
the current max username length.

This is done because:
- it is in theory possible for the max length to change at run-time
  (e.g., a new user is added after top starts running)
- on machines with many users this delays startup significantly

PR: 20799
PR: 89762
Reported by: ob@e-Gitt.NET
Reported by: wkwu@Kavalan.csie.NCTU.edu.tw
Reported on: 2000-08-23 and 2005-11-30

6 years agoRevert last change to file/magic/Magdir/elf, it misidentifies most shared
Antoine Brodin [Sun, 20 May 2018 22:07:44 +0000 (22:07 +0000)]
Revert last change to file/magic/Magdir/elf, it misidentifies most shared
libraries installed from ports as pie executables instead of shared libraries,
and consequently breaks ports.

6 years agoUse St macro for specifying C standards.
Sevan Janiyan [Sun, 20 May 2018 21:56:08 +0000 (21:56 +0000)]
Use St macro for specifying C standards.

Reported by: rgrimes@

6 years agoAF_UNIX gc unused label
Matt Macy [Sun, 20 May 2018 21:37:34 +0000 (21:37 +0000)]
AF_UNIX gc unused label

...sigh

6 years agoAF_UNIX: Don't unlock unp/unp2 if they're not locked
Matt Macy [Sun, 20 May 2018 21:20:26 +0000 (21:20 +0000)]
AF_UNIX: Don't unlock unp/unp2 if they're not locked

Reported by: mjg

6 years agomake sure vnet is set when freeing
Matt Macy [Sun, 20 May 2018 20:48:26 +0000 (20:48 +0000)]
make sure vnet is set when freeing

Reported by: pho

6 years agopmc: detach free_gtask on unload
Matt Macy [Sun, 20 May 2018 20:34:15 +0000 (20:34 +0000)]
pmc: detach free_gtask on unload

Reported by: pho

6 years agoFix a typo and remove an unneeded Tn macro as highlighted by mandoc -Tlint.
Sevan Janiyan [Sun, 20 May 2018 20:28:17 +0000 (20:28 +0000)]
Fix a typo and remove an unneeded Tn macro as highlighted by mandoc -Tlint.

Submitted by: Mateusz Piotrowski
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D15204

6 years agoin(s)_moptions: free before tearing down inpcb
Matt Macy [Sun, 20 May 2018 20:08:21 +0000 (20:08 +0000)]
in(s)_moptions: free before tearing down inpcb

6 years agopmc: avoid potential race on shutdown
Matt Macy [Sun, 20 May 2018 19:35:24 +0000 (19:35 +0000)]
pmc: avoid potential race on shutdown

Clear shutdown flag first, conservatively allow 5ms for all hardclock consumers to
see flag before drainining

6 years agoFix build with PSERIES but not POWERNV defined.
Nathan Whitehorn [Sun, 20 May 2018 18:26:09 +0000 (18:26 +0000)]
Fix build with PSERIES but not POWERNV defined.

6 years agobsd-family-tree: announce DragonFly 5.2.1
Eitan Adler [Sun, 20 May 2018 18:18:56 +0000 (18:18 +0000)]
bsd-family-tree: announce DragonFly 5.2.1

See
http://lists.dragonflybsd.org/pipermail/commits/2018-May/672214.html

6 years agotop(1): unconditionally assume we are on FreeBSD (more unifdef)
Eitan Adler [Sun, 20 May 2018 18:11:58 +0000 (18:11 +0000)]
top(1): unconditionally assume we are on FreeBSD (more unifdef)

Now that we're our own upstream, remove useless ifdefs.

6 years agoRetry revert
Eitan Adler [Sun, 20 May 2018 18:03:40 +0000 (18:03 +0000)]
Retry revert

I had a local modification before my revert. Try reverting one more time.

6 years agorevert r333928
Eitan Adler [Sun, 20 May 2018 18:02:40 +0000 (18:02 +0000)]
revert r333928

I had missed a file when testing this, and it does not build. Will try again.

6 years agotop(1): Make lack of "percent" information explicit
Eitan Adler [Sun, 20 May 2018 17:59:59 +0000 (17:59 +0000)]
top(1): Make lack of "percent" information explicit

When count is 1, no delta information can be produced. Make this
explicit.

PR: 195717
Submitted by: fernape

6 years agotop(1): remove 'xs' and 'xh' source files
Eitan Adler [Sun, 20 May 2018 17:58:22 +0000 (17:58 +0000)]
top(1): remove 'xs' and 'xh' source files

Now that we're our own upstream these files buy us nothing.

6 years agosh: Allow unquoted newlines in word in ${param+word} etc.
Jilles Tjoelker [Sun, 20 May 2018 17:25:52 +0000 (17:25 +0000)]
sh: Allow unquoted newlines in word in ${param+word} etc.

POSIX requires accepting unquoted newlines in word in parameter expansions
like ${param+word}, ${param#word}, although the Bourne shell did not support
it, it is not commonly used and might make it harder to find a missing
closing brace.

It was also strange that something like

foo="${bar#
}"

was rejected.

Reported by: Martijn Dekker via Robert Elz

6 years agoteken, vt(4): Parse the "Cursor style" escape sequence
Jean-Sébastien Pédron [Sun, 20 May 2018 14:21:20 +0000 (14:21 +0000)]
teken, vt(4): Parse the "Cursor style" escape sequence

The escape sequence (e.g. `^[[2 q`) was unsupported before and the
letter `q` was displayed as a typed character. The sequence is used by
Neovim for instance.

Now, it is properly parsed. However, it is ignored, so it won't change
the cursor style.

Because the escape sequence contains a space character, the
`gensequences` script had to be modified to support that. In the
`sequences` file, a space is represented as the string `SP`.

6 years agonfsclient: warnings cleanups
Matt Macy [Sun, 20 May 2018 06:14:12 +0000 (06:14 +0000)]
nfsclient: warnings cleanups

6 years agoStyle fixup:
Cy Schubert [Sun, 20 May 2018 05:59:42 +0000 (05:59 +0000)]
Style fixup:

A non-functional commit to make adjustment to an aesthetically
unpleasing long line.

6 years agoFix build post r333919.
Cy Schubert [Sun, 20 May 2018 05:59:35 +0000 (05:59 +0000)]
Fix build post r333919.

This commit results in an aesthetically unpleasing long line
which will be fixed next commit.

6 years agoAF_UNIX: fix LOR introduced by the locking rewrite
Matt Macy [Sun, 20 May 2018 05:50:53 +0000 (05:50 +0000)]
AF_UNIX: fix LOR introduced by the locking rewrite

6 years agoAdd additional preinitialized cap_rights
Matt Macy [Sun, 20 May 2018 05:13:12 +0000 (05:13 +0000)]
Add additional preinitialized cap_rights

6 years agoMFV: file 5.33
Eitan Adler [Sun, 20 May 2018 05:06:42 +0000 (05:06 +0000)]
MFV: file 5.33

Merge the latest file(1) in.

Relevent Changelog:
- extend the support for ${x?:} expansions for magic descriptions
- add support for ${x?:} in mime types to handle pie binaries.
- add support for negative offsets (offsets from the end of file)
- close the file on error when writing magic

Relnotes: yes

6 years agoVendor import of file 5.33
Eitan Adler [Sun, 20 May 2018 04:56:46 +0000 (04:56 +0000)]
Vendor import of file 5.33

6 years agovfs: simplify vop_stdlock/unlock
Mateusz Guzik [Sun, 20 May 2018 04:45:05 +0000 (04:45 +0000)]
vfs: simplify vop_stdlock/unlock

The interlock pointer is non-NULL by definition and the compiler see through
that and eliminates the NULL checks. Just remove them from the code as they
play no role.

No difference in generated assembly.

6 years agoinpcb: defer destruction of inpcb until after a grace period has elapsed
Matt Macy [Sun, 20 May 2018 04:38:04 +0000 (04:38 +0000)]
inpcb: defer destruction of inpcb until after a grace period has elapsed

in_pcbfree will remove the incpb from the list and release the rtentry
while the vnet is set, but the actual destruction will be deferred
until any threads in a (not yet used) epoch section, no longer potentially
have references.

6 years agoAF_UNIX: make unpcb lock name line up with what's in witness
Matt Macy [Sun, 20 May 2018 04:32:48 +0000 (04:32 +0000)]
AF_UNIX: make unpcb lock name line up with what's in witness

6 years agoepoch.h: hide proc.h->priority.h from user
Matt Macy [Sun, 20 May 2018 04:15:12 +0000 (04:15 +0000)]
epoch.h: hide proc.h->priority.h from user

6 years agoAdd support for the XIVE XICS emulation mode for POWER9 systems
Justin Hibbits [Sun, 20 May 2018 03:23:17 +0000 (03:23 +0000)]
Add support for the XIVE XICS emulation mode for POWER9 systems

Summary:
POWER9 systems use a new interrupt controller, XIVE, managed through OPAL
firmware calls.  The OPAL firmware includes support for emulating the previous
generation XICS presentation layer in addition to a new "XIVE Exploitation"
mode.  As a stopgap until we have XIVE exploitation mode, enable XICS emulation
mode so that we at least have an interrupt controller.

Since the CPPR is local to the current CPU, it cannot be updated for APs when
initializing on the BSP.  This adds a new function, directly called by the
powernv platform code, to initialize the CPPR on AP bringup.

Reviewed by: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D15492

6 years agoinpcb: consolidate possible deletion in pcblist functions in to epoch
Matt Macy [Sun, 20 May 2018 02:27:58 +0000 (02:27 +0000)]
inpcb: consolidate possible deletion in pcblist functions in to epoch
deferred context.