]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agocxgbetool(8): Provide user interface for hashfilters, hardware NAT, and
Navdeep Parhar [Tue, 15 May 2018 04:31:11 +0000 (04:31 +0000)]
cxgbetool(8): Provide user interface for hashfilters, hardware NAT, and
other filtering related features that were recently added to the driver.

Sponsored by: Chelsio Communications

6 years agocxgbe(4): Filtering related features and fixes.
Navdeep Parhar [Tue, 15 May 2018 04:24:38 +0000 (04:24 +0000)]
cxgbe(4): Filtering related features and fixes.

- Driver support for hardware NAT.
- Driver support for swapmac action.
- Validate a request to create a hashfilter against the filter mask.
- Add a hashfilter config file for T5.

Sponsored by: Chelsio Communications

6 years agosubr_pidctrl: use standard 2-Clause FreeBSD license and disclaimer
Ed Maste [Tue, 15 May 2018 00:50:09 +0000 (00:50 +0000)]
subr_pidctrl: use standard 2-Clause FreeBSD license and disclaimer

Approved by: jeff

6 years agoLet mmcsd_ioctl() ensure appropriate privileges via priv_check(9).
Marius Strobl [Mon, 14 May 2018 21:57:45 +0000 (21:57 +0000)]
Let mmcsd_ioctl() ensure appropriate privileges via priv_check(9).

6 years agoThe broken DDR52 support of Intel Bay Trail eMMC controllers rumored
Marius Strobl [Mon, 14 May 2018 21:46:06 +0000 (21:46 +0000)]
The broken DDR52 support of Intel Bay Trail eMMC controllers rumored
in the commit log of r321385 has been confirmed via the public VLI54
erratum. Thus, stop advertising DDR52 for these controllers.
Note that this change should hardly make a difference in practice as
eMMC chips from the same era as these SoCs most likely support HS200
at least, probably even up to HS400ES.

6 years agoReplace rmlock with epoch in lagg
Stephen Hurd [Mon, 14 May 2018 20:06:49 +0000 (20:06 +0000)]
Replace rmlock with epoch in lagg

Use the new epoch based reclamation API. Now the hot paths will not
block at all, and the sx lock is used for the softc data.  This fixes LORs
reported where the rwlock was obtained when the sxlock was held.

Submitted by: mmacy
Reported by: Harry Schmalzbauer <freebsd@omnilan.de>
Reviewed by: sbruno
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15355

6 years agoMake the common interrupt entry point labels local labels.
John Baldwin [Mon, 14 May 2018 17:27:53 +0000 (17:27 +0000)]
Make the common interrupt entry point labels local labels.

Kernel debuggers depend on symbol names to find stack frames with a
trapframe rather than a normal stack frame.  The labels used for the
shared interrupt entry point for the PTI and non-PTI cases did not
match the existing patterns confusing debuggers.  Add the '.L' prefix
to mark these symbols as local so they are not visible in the symbol
table.

Reviewed by: kib
MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agosctp_get_mbuf_for_msg() should honor the allinone parameter.
Michael Tuexen [Mon, 14 May 2018 15:16:51 +0000 (15:16 +0000)]
sctp_get_mbuf_for_msg() should honor the allinone parameter.

When it is not required that the buffer is not a chain, return
a chain. This is based on a patch provided by Irene Ruengeler.

6 years agoEnsure that the MTU's used are multiple of 4.
Michael Tuexen [Mon, 14 May 2018 13:50:17 +0000 (13:50 +0000)]
Ensure that the MTU's used are multiple of 4.

The length of SCTP packets is always a multiple of 4. Therefore,
ensure that the MTUs used are also a multiple of 4.

Thanks to Irene Ruengeler for providing an earlier version of this
patch.

MFC after: 1 week

6 years agohwpmc: don't reference domain index with no memory backing it
Matt Macy [Mon, 14 May 2018 06:11:25 +0000 (06:11 +0000)]
hwpmc: don't reference domain index with no memory backing it

On multi-socket the domain will be correctly set for a given CPU
regardless of whether or not NUMA is enabled.

Approved by: sbruno

6 years agoHandle thread-local storage (TLS) segments correctly when
Phil Shafer [Mon, 14 May 2018 05:21:18 +0000 (05:21 +0000)]
Handle thread-local storage (TLS) segments correctly when
copying (objcopy) and displaying (readelf) them.

PR: 227552
Submitted by: kaiw (maintainer)
Reported by: jachmann@unitix.org
Reviewed by: phil
MFC after: 1 day

6 years agoFinal fix for alignment issues with the page table first patched with
Nathan Whitehorn [Mon, 14 May 2018 04:00:52 +0000 (04:00 +0000)]
Final fix for alignment issues with the page table first patched with
r333273 and partially reverted with r333594.

Older CPUs implement addition of offsets into the page table by a
bitwise OR rather than actual addition, which only works if the table is
aligned at a multiple of its own size (they also require it to be aligned
at a multiple of 256KB). Newer ones do not have that requirement, but it
hardly matters to enforce it anyway.

The original code was failing on newer systems with huge amounts of RAM
(> 512 GB), in which the page table was 4 GB in size. Because the
bootstrap memory allocator took its alignment parameter as an int, this
turned into a 0, removing any alignment constraint at all and making
the MMU fail. The first round of this patch (r333273) fixed this case by
aligning it at 256 KB, which broke older CPUs. Fix this instead by widening
the alignment parameter.

6 years agopmc: don't add pmc owner to list until setup is complete
Matt Macy [Mon, 14 May 2018 01:08:47 +0000 (01:08 +0000)]
pmc: don't add pmc owner to list until setup is complete

Once a pmc owner is added to the pmc_ss_owners list it is
visible for all to see. We don't want this to happen until
setup is complete.

Reported by: mjg
Approved by: sbruno

6 years agopmc: fix buildworld
Matt Macy [Mon, 14 May 2018 00:56:33 +0000 (00:56 +0000)]
pmc: fix buildworld

hid ck_queue.h from user

Approved by: sbruno

6 years agohwpmc: fix load/unload race and vm map LOR
Matt Macy [Mon, 14 May 2018 00:21:04 +0000 (00:21 +0000)]
hwpmc: fix load/unload race and vm map LOR

- fix load/unload race by allocating the per-domain list structure at boot

- fix long extant vm map LOR by replacing pmc_sx sx_slock with global_epoch
  to protect the liveness of elements of the pmc_ss_owners list

Reported by: pho
Approved by: sbruno

6 years agoepoch(9): allow sx locks to be held across epoch_wait()
Matt Macy [Mon, 14 May 2018 00:14:00 +0000 (00:14 +0000)]
epoch(9): allow sx locks to be held across epoch_wait()

The INVARIANTS checks in epoch_wait() were intended to
prevent the block handler from returning with locks held.
What it in fact did was preventing anything except Giant
from being held across it. Check that the number of locks
held has not changed instead.

Approved by: sbruno@

6 years agoRevert changes to hash table alignment in r333273, which booting on all G5
Nathan Whitehorn [Sun, 13 May 2018 23:56:43 +0000 (23:56 +0000)]
Revert changes to hash table alignment in r333273, which booting on all G5
systems, pending further analysis.

6 years agoFix the eir_server_scope reply argument for NFSv4.1 ExchangeID.
Rick Macklem [Sun, 13 May 2018 23:38:01 +0000 (23:38 +0000)]
Fix the eir_server_scope reply argument for NFSv4.1 ExchangeID.

In the reply to an ExchangeID operation, the NFSv4.1 server returns a
"scope" value (eir_server_scope). If this value is the same, it indicates
that two servers share state, which is never the case for FreeBSD servers.
As such, the value needs to be unique and it was without this patch.
However, I just found out that it is not supposed to change when the
server reboots and without this patch, it did change.
This patch fixes eir_server_scope so that it does not change when the
server is rebooted.
The only affect not having this patch has is that Linux clients don't
reclaim opens and locks after a server reboot, which meant they lost
any byte range locks held before the server rebooted.
It only affects NFSv4.1 mounts and the FreeBSD NFSv4.1 client was not
affected by this bug.

MFC after: 1 week

6 years agoepoch(9): cleanups, additional debug checks, and add global_epoch
Matt Macy [Sun, 13 May 2018 23:24:48 +0000 (23:24 +0000)]
epoch(9): cleanups, additional debug checks, and add global_epoch

- GC the _nopreempt routines
    - to really benefit we'd need a separate routine
    - they're not currently in use
    - they complicate the API for no benefit at this time

- check that we're actually in a epoch section at exit

- handle epoch_call() early in boot

- Fix copyright declaration language

Approved by: sbruno@

6 years agoAdd epoch(9) man page
Matt Macy [Sun, 13 May 2018 23:16:04 +0000 (23:16 +0000)]
Add epoch(9) man page

Reviewed by: gallatin@
Approved by: sbruno@

6 years agoRegen after r333588
Sevan Janiyan [Sun, 13 May 2018 23:04:35 +0000 (23:04 +0000)]
Regen after r333588

6 years agoTypo
Sevan Janiyan [Sun, 13 May 2018 22:58:40 +0000 (22:58 +0000)]
Typo

Submitted by: jrm@
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D14836

6 years agoFix PMC_IN_TRAP_HANDLER() for i386 after the 4/4 split.
Konstantin Belousov [Sun, 13 May 2018 20:10:02 +0000 (20:10 +0000)]
Fix PMC_IN_TRAP_HANDLER() for i386 after the 4/4 split.

Sponsored by: The FreeBSD Foundation

6 years agoFix directory blocks checksumming.
Fedor Uporov [Sun, 13 May 2018 19:48:30 +0000 (19:48 +0000)]
Fix directory blocks checksumming.

Reviewed by:    pfg
MFC after:      3 months

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

6 years agoFix on-disk inode checksum calculation logic.
Fedor Uporov [Sun, 13 May 2018 19:29:35 +0000 (19:29 +0000)]
Fix on-disk inode checksum calculation logic.

Reviewed by:    pfg
MFC after:      3 months

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

6 years agoFix EXT2FS_DEBUG definition usage.
Fedor Uporov [Sun, 13 May 2018 19:19:10 +0000 (19:19 +0000)]
Fix EXT2FS_DEBUG definition usage.

Reviewed by:    pfg
MFC after:      3 months

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

6 years agoGet rid of vm_pageout_page_queued().
Mark Johnston [Sun, 13 May 2018 13:00:59 +0000 (13:00 +0000)]
Get rid of vm_pageout_page_queued().

vm_page_queue(), added in r333256, generalizes vm_pageout_page_queued(),
so use it instead.  No functional change intended.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D15402

6 years agoFix a slow leak of session structures in the NFSv4.1 server.
Rick Macklem [Sun, 13 May 2018 12:42:53 +0000 (12:42 +0000)]
Fix a slow leak of session structures in the NFSv4.1 server.

For a fairly rare case of a client doing an ExchangeID after a hard reboot,
the old confirmed clientid still exists, but some clients use a new
co_verifier. For this case, the server was not freeing up the sessions on
the old confirmed clientid.
This patch fixes this case. It also adds two LIST_INIT() macros, which are
actually no-ops, since the structure is malloc()d with M_ZERO so the pointer
is already set to NULL.
It should have minimal impact, since the only way I could exercise this
code path was by doing a hard power cycle (pulling the plus) on a machine
running Linux with a NFSv4.1 mount on the server.
Originally spotted during testing of the ESXi 6.5 client.

Tested by: andreas.nagy@frequentis.com
MFC after: 2 months

6 years agoThe NFSv4.1 server should return NFSERR_BACKCHANBUSY instead of NFS_OK.
Rick Macklem [Sun, 13 May 2018 12:29:09 +0000 (12:29 +0000)]
The NFSv4.1 server should return NFSERR_BACKCHANBUSY instead of NFS_OK.

When an NFSv4.1 session is busy due to a callback being in progress,
nfsrv_freesession() should return NFSERR_BACKCHANBUSY instead of NFS_OK.
The only effect this has is that the DestroySession operation will report
the failure for this case and this probably has little or no effect on a
client. Spotted by inspection and no failures related to this have been
reported.

MFC after: 2 months

6 years agoAdd implementations for clog(3), clogf(3), and clog(3).
Konstantin Belousov [Sun, 13 May 2018 09:54:34 +0000 (09:54 +0000)]
Add implementations for clog(3), clogf(3), and clog(3).

PR: 216863
Submitted by: bde, Steven G. Kargl <sgk@troutmask.apl.washington.edu>
MFC after: 2 weeks

6 years agoDetect and optimize reads from the hole on UFS.
Konstantin Belousov [Sun, 13 May 2018 09:47:28 +0000 (09:47 +0000)]
Detect and optimize reads from the hole on UFS.

- Create getblkx(9) variant of getblk(9) which can return error.
- Add GB_NOSPARSE flag for getblk()/getblkx() which requests that BMAP
  was performed before the buffer is created, and EJUSTRETURN returned
  in case the requested block does not exist.
- Make ffs_read() use GB_NOSPARSE to avoid instantiating buffer (and
  allocating the pages for it), copying from zero_region instead.

The end result is less page allocations and buffer recycling when a
hole is read, which is important for some benchmarks.

Requested and reviewed by: jeff
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D14917

6 years agohwpmc/epoch - don't reference domain if NUMA is not set
Matt Macy [Sat, 12 May 2018 20:00:29 +0000 (20:00 +0000)]
hwpmc/epoch - don't reference domain if NUMA is not set

It appears that domain information is set correctly independent
of whether or not NUMA is defined. However, there is no memory
backing secondary domains leading to allocation failure.

Reported by: pho@, np@
Approved by: sbruno@

6 years agoIf the sole non-option command line argument is "none", remove any
Dag-Erling Smørgrav [Sat, 12 May 2018 18:07:53 +0000 (18:07 +0000)]
If the sole non-option command line argument is "none", remove any
pre-existing forwarder configuration and set Unbound up to recurse.

PR: 222902
MFC after: 1 week

6 years agoRename all Unbound binaries and man pages from unbound* to local-unbound*.
Dag-Erling Smørgrav [Sat, 12 May 2018 17:10:36 +0000 (17:10 +0000)]
Rename all Unbound binaries and man pages from unbound* to local-unbound*.

PR: 222902

6 years agoSupport If-Modified-Since for https as well as http.
Dag-Erling Smørgrav [Sat, 12 May 2018 17:04:40 +0000 (17:04 +0000)]
Support If-Modified-Since for https as well as http.

PR: 224426
Submitted by: zsnafzig@edu.uwaterloo.ca
MFC after: 1 week

6 years agoPreserve if-modified-since timestamps across redirects.
Dag-Erling Smørgrav [Sat, 12 May 2018 17:02:27 +0000 (17:02 +0000)]
Preserve if-modified-since timestamps across redirects.

PR: 224426
MFC after: 1 week

6 years agoDTrace aarch64: Avoid calling unwind_frame() in the probe context.
Mark Johnston [Sat, 12 May 2018 15:35:26 +0000 (15:35 +0000)]
DTrace aarch64: Avoid calling unwind_frame() in the probe context.

unwind_frame() may be instrumented by FBT, leading to recursion into
dtrace_probe(). Manually inline unwind_frame() as we do with stack
unwinding code for other architectures.

Submitted by: Domagoj Stolfa
Reviewed by: manu
MFC after: 1 week
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D15359

6 years agocpucontrol: improve Intel microcode revision check
Ed Maste [Sat, 12 May 2018 15:34:35 +0000 (15:34 +0000)]
cpucontrol: improve Intel microcode revision check

According to the Intel SDM (Volme 3, 9.11.7) the BIOS signature MSR
should be zeroed before executing cpuid (although in practice it does
not seem to matter).

PR: 192487
Submitted by: Dan Lukes
Reported by: Henrique de Moraes Holschuh
MFC after: 3 days

6 years agoUpgrade Unbound to 1.7.1.
Dag-Erling Smørgrav [Sat, 12 May 2018 15:20:39 +0000 (15:20 +0000)]
Upgrade Unbound to 1.7.1.

6 years agoUpgrade Unbound to 1.7.0. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 15:04:05 +0000 (15:04 +0000)]
Upgrade Unbound to 1.7.0.  More to follow.

6 years agoUpgrade Unbound to 1.6.8. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:57:42 +0000 (14:57 +0000)]
Upgrade Unbound to 1.6.8.  More to follow.

6 years agoNo reason to keep this around.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:51:53 +0000 (14:51 +0000)]
No reason to keep this around.

6 years agoUpgrade Unbound to 1.6.7. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:51:18 +0000 (14:51 +0000)]
Upgrade Unbound to 1.6.7.  More to follow.

6 years agoUpgrade Unbound to 1.6.6. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:48:38 +0000 (14:48 +0000)]
Upgrade Unbound to 1.6.6.  More to follow.

6 years agoUpgrade Unbound to 1.6.5. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:39:41 +0000 (14:39 +0000)]
Upgrade Unbound to 1.6.5.  More to follow.

6 years agoUpgrade Unbound to 1.6.4. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:36:58 +0000 (14:36 +0000)]
Upgrade Unbound to 1.6.4.  More to follow.

6 years agoUpgrade Unbound to 1.6.3. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:19:14 +0000 (14:19 +0000)]
Upgrade Unbound to 1.6.3.  More to follow.

6 years agoUpgrade Unbound to 1.6.2. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:15:39 +0000 (14:15 +0000)]
Upgrade Unbound to 1.6.2.  More to follow.

6 years agoUpgrade Unbound to 1.6.1. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:04:48 +0000 (14:04 +0000)]
Upgrade Unbound to 1.6.1.  More to follow.

6 years agoUpgrade Unbound to 1.6.1. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 14:04:30 +0000 (14:04 +0000)]
Upgrade Unbound to 1.6.1.  More to follow.

6 years agoaw_mmc: Rework regulator handling
Emmanuel Vadot [Sat, 12 May 2018 13:14:01 +0000 (13:14 +0000)]
aw_mmc: Rework regulator handling

Don't enable regulator on attach but dealt with them on power_up/power_off
Only set the voltage for the signaling regulator since I don't have boards
that can change the supply voltage.
Enable 1.8v signaling voltage.

6 years agoaw_mmc: Do not fully init the controller in attach
Emmanuel Vadot [Sat, 12 May 2018 13:13:34 +0000 (13:13 +0000)]
aw_mmc: Do not fully init the controller in attach

Only do a reset of the controller at attach and init it at power_up.
We use to enable some interrupts in reset, only enable the interrupts
we are interested in when doing a request.
While here remove the regulators handling in power_on as it is very wrong
and will be dealt with in another commit.

Tested on: A31, A64

6 years agoaw_mmc: Remove hardware reset
Emmanuel Vadot [Sat, 12 May 2018 13:12:59 +0000 (13:12 +0000)]
aw_mmc: Remove hardware reset

From all the BSP (Board Source Package) source that I've looked at it seems
that it's never done, remove it.

Tested On: A31, A64

6 years agoaw_mmc: Read interrupt register value before writing to it
Emmanuel Vadot [Sat, 12 May 2018 13:12:26 +0000 (13:12 +0000)]
aw_mmc: Read interrupt register value before writing to it

Reported by: jmcneill

6 years agoUpgrade Unbound to 1.6.0. More to follow.
Dag-Erling Smørgrav [Sat, 12 May 2018 12:57:34 +0000 (12:57 +0000)]
Upgrade Unbound to 1.6.0.  More to follow.

6 years agoUpgrade LDNS to 1.7.0.
Dag-Erling Smørgrav [Sat, 12 May 2018 12:00:18 +0000 (12:00 +0000)]
Upgrade LDNS to 1.7.0.

I've been holding back on this because 1.7.0 requires OpenSSL 1.1.0 or
newer for full DANE support.  But we can't wait forever, and nothing in
base uses DANE anyway, so here we go.

6 years agoVendor import of Unbound 1.7.1.
Dag-Erling Smørgrav [Sat, 12 May 2018 11:56:52 +0000 (11:56 +0000)]
Vendor import of Unbound 1.7.1.

6 years agoVendor import of Unbound 1.7.0.
Dag-Erling Smørgrav [Sat, 12 May 2018 11:56:38 +0000 (11:56 +0000)]
Vendor import of Unbound 1.7.0.

6 years agoVendor import of Unbound 1.6.8.
Dag-Erling Smørgrav [Sat, 12 May 2018 11:56:13 +0000 (11:56 +0000)]
Vendor import of Unbound 1.6.8.

6 years agoVendor import of Unbound 1.6.7.
Dag-Erling Smørgrav [Sat, 12 May 2018 11:55:57 +0000 (11:55 +0000)]
Vendor import of Unbound 1.6.7.

6 years agoVendor import of Unbound 1.6.6.
Dag-Erling Smørgrav [Sat, 12 May 2018 11:55:17 +0000 (11:55 +0000)]
Vendor import of Unbound 1.6.6.

6 years agoVendor import of Unbound 1.6.5.
Dag-Erling Smørgrav [Sat, 12 May 2018 11:54:48 +0000 (11:54 +0000)]
Vendor import of Unbound 1.6.5.

6 years agoVendor import of Unbound 1.6.4.
Dag-Erling Smørgrav [Sat, 12 May 2018 11:54:35 +0000 (11:54 +0000)]
Vendor import of Unbound 1.6.4.

6 years agoVendor import of Unbound 1.6.3.
Dag-Erling Smørgrav [Sat, 12 May 2018 11:53:55 +0000 (11:53 +0000)]
Vendor import of Unbound 1.6.3.

6 years agoAdd a test for vm86(2), simple to use and diagnose.
Konstantin Belousov [Sat, 12 May 2018 11:53:49 +0000 (11:53 +0000)]
Add a test for vm86(2), simple to use and diagnose.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoVendor import of Unbound 1.6.2.
Dag-Erling Smørgrav [Sat, 12 May 2018 11:53:39 +0000 (11:53 +0000)]
Vendor import of Unbound 1.6.2.

6 years agoVendor import of Unbound 1.6.1.
Dag-Erling Smørgrav [Sat, 12 May 2018 11:49:30 +0000 (11:49 +0000)]
Vendor import of Unbound 1.6.1.

6 years agoKernel entry from vm86 mode, where PCB_VM86CALL pcb flag is not set,
Konstantin Belousov [Sat, 12 May 2018 11:06:59 +0000 (11:06 +0000)]
Kernel entry from vm86 mode, where PCB_VM86CALL pcb flag is not set,
is executed on the right stack already.  No copy from the entry stack
to the kstack must be performed for vm86 bios call code to function.

To access the pcb flags on kernel entry, unconditionally switch to
kernel address space if vm86 mode is detected.

This fixes very early vm86 bios calls, typically done when boot is
performed by boot2 without loader, and kernel falls back to BIOS calls
to get SMAP.

Reported by: bde
Sponsored by: The FreeBSD Foundation

6 years agoOn return from exception or interrupt, returns to vm86 mode with
Konstantin Belousov [Sat, 12 May 2018 11:02:39 +0000 (11:02 +0000)]
On return from exception or interrupt, returns to vm86 mode with
PCB_VM86CALL pcb flag not set should be treated same as return to
userspace.

Most important, the address space must be switched.  This fixes
usermode vm86 operations after the 4/4 split.

Sponsored by: The FreeBSD Foundation

6 years agoInitialize tramp_idleptd during cold pmap startup, before the
Konstantin Belousov [Sat, 12 May 2018 10:57:34 +0000 (10:57 +0000)]
Initialize tramp_idleptd during cold pmap startup, before the
exception code is copied to the trampoline.

The correct value is then copied to trampoline automatically, so
tramp_idleptd_reloced can be eliminated.

This will allow to use the same exception entry code to handle traps
from vm86 bios calls on early boot stage, as after the trampoline is
configured.

Sponsored by: The FreeBSD Foundation

6 years agoCreate a macro for PIC code which loads %cr3 from tramp_idleptd.
Konstantin Belousov [Sat, 12 May 2018 10:51:50 +0000 (10:51 +0000)]
Create a macro for PIC code which loads %cr3 from tramp_idleptd.

Sponsored by: The FreeBSD Foundation

6 years agoFix use of the custom TSS on i386 after the 4/4 split.
Konstantin Belousov [Sat, 12 May 2018 10:48:53 +0000 (10:48 +0000)]
Fix use of the custom TSS on i386 after the 4/4 split.

Record common_tssd, the descriptor to be written in GDT to point to
the common TSS, before LTR is executed.  The LTR instruction sets the
loaded descriptor type to 386 TSS busy, which traps on reloads.

Sponsored by: The FreeBSD Foundation

6 years agoPROC_PDEATHSIG_CTL will appear first in 11.2.
Konstantin Belousov [Sat, 12 May 2018 10:11:33 +0000 (10:11 +0000)]
PROC_PDEATHSIG_CTL will appear first in 11.2.

Submitted by: Thomas Munro
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D15399

6 years agoRemove the ability to generate long since useless SSH1 RSA keys.
Dag-Erling Smørgrav [Sat, 12 May 2018 08:23:17 +0000 (08:23 +0000)]
Remove the ability to generate long since useless SSH1 RSA keys.

6 years agodwatch(1): Refactor sendrecv profile
Devin Teske [Sat, 12 May 2018 06:23:30 +0000 (06:23 +0000)]
dwatch(1): Refactor sendrecv profile

The profile for send(2)/recv(2) observation has been refactored to
eliminate alloca() in favor of translations available in HEAD.

Sponsored by: Smule, Inc.

6 years agodwatch(1): Expose process for ip/tcp/udp
Devin Teske [Sat, 12 May 2018 06:18:15 +0000 (06:18 +0000)]
dwatch(1): Expose process for ip/tcp/udp

Knowing the value of execname during these probes is of some value even
if it is commonly the interrupt kernel thread (intr[12]) -- quite often
it is not, but that depends on the probe.

Sponsored by: Smule, Inc.

6 years agodwatch(1): Allow `-E code' to override profile EVENT_DETAILS
Devin Teske [Sat, 12 May 2018 06:01:41 +0000 (06:01 +0000)]
dwatch(1): Allow `-E code' to override profile EVENT_DETAILS

This allows quick changes to the formatted output of a profile.

Sponsored by: Smule, Inc.

6 years agodwatch(1): Export ARGV to profiles loaded via load_profile()
Devin Teske [Sat, 12 May 2018 05:49:31 +0000 (05:49 +0000)]
dwatch(1): Export ARGV to profiles loaded via load_profile()

A module that wishes to post-process the output needs to know which
arguments were passed in order to re-execute a child in a pipe-chain.
Further, the expansion of ARGV needs to be such that items are escaped
properly.

Sponsored by: Smule, Inc.

6 years agodwatch(1): Simplify info message test
Devin Teske [Sat, 12 May 2018 05:43:47 +0000 (05:43 +0000)]
dwatch(1): Simplify info message test

The info() function already tests $QUIET

Sponsored by: Smule, Inc.

6 years agodwatch(1): Separate default values so `-[BK] num' don't affect usage
Devin Teske [Sat, 12 May 2018 05:41:28 +0000 (05:41 +0000)]
dwatch(1): Separate default values so `-[BK] num' don't affect usage

If you were to pass an invalid option after `-B num' or `-K num' you
would see that the usage statement would show the value you passed
instead of the actual default.

Moving the default values to separate variables that are unaffected
by the options-parsing allows the usage statement to correctly show
the hard-coded default values if no flags are used.

Sponsored by: Smule, Inc.

6 years agodwatch(1): Bugfix, usage displayed with `-1Q'
Devin Teske [Sat, 12 May 2018 05:36:47 +0000 (05:36 +0000)]
dwatch(1): Bugfix, usage displayed with `-1Q'

A return statement should have been an exit in list_profiles().
If the user passed `-Q' to list profiles and asked for one-line
per profile (`-1'), list_profiles() would not exit as should.

Sponsored by: Smule, Inc.

6 years agohwpmc(9): clear remaining sample work for hardclock
Matt Macy [Sat, 12 May 2018 03:45:30 +0000 (03:45 +0000)]
hwpmc(9): clear remaining sample work for hardclock

- fix last minute change in 333509 where by runcount references
  to a pmc would remaining causing us to pause loop forever

Approved by: sbruno

6 years agoRemove extra copy of bcopy.c now that we're using the libkern version
Warner Losh [Sat, 12 May 2018 01:43:32 +0000 (01:43 +0000)]
Remove extra copy of bcopy.c now that we're using the libkern version
of this file.

6 years agohwpmc(9): Make pmclog buffer pcpu and update constants
Matt Macy [Sat, 12 May 2018 01:26:34 +0000 (01:26 +0000)]
hwpmc(9): Make pmclog buffer pcpu and update constants

On non-trivial SMP systems the contention on the pmc_owner mutex leads
to a substantial number of samples captured being from the pmc process
itself. This change a) makes buffers larger to avoid contention on the
global list b) makes the working sample buffer per cpu.

Run pmcstat in the background (default event rate of 64k):
pmcstat -S UNHALTED_CORE_CYCLES -O /dev/null sleep 600 &

Before:
make -j96 buildkernel -s >&/dev/null 3336.68s user 24684.10s system 7442% cpu 6:16.50 total

After:
make -j96 buildkernel -s >&/dev/null 2697.82s user 1347.35s system 6058% cpu 1:06.77 total

For more realistic overhead measurement set the sample rate for ~2khz
on a 2.1Ghz processor:
pmcstat -n 1050000 -S UNHALTED_CORE_CYCLES -O /dev/null sleep 6000 &

Collecting 10 samples of `make -j96 buildkernel` from each:

x before
+ after

real time:
    N           Min           Max        Median           Avg        Stddev
x  10          76.4        127.62        84.845        88.577     15.100031
+  10         59.71         60.79        60.135        60.179    0.29957192
Difference at 95.0% confidence
        -28.398 +/- 10.0344
        -32.0602% +/- 7.69825%
        (Student's t, pooled s = 10.6794)

system time:
    N           Min           Max        Median           Avg        Stddev
x  10       2277.96       6948.53       2949.47      3341.492     1385.2677
+  10        1038.7       1081.06      1070.555      1064.017      15.85404
Difference at 95.0% confidence
        -2277.47 +/- 920.425
        -68.1574% +/- 8.77623%
        (Student's t, pooled s = 979.596)

x no pmc
+ pmc running
real time:

HEAD:
    N           Min           Max        Median           Avg        Stddev
x  10         58.38         59.15         58.86        58.847    0.22504567
+  10          76.4        127.62        84.845        88.577     15.100031
Difference at 95.0% confidence
        29.73 +/- 10.0335
        50.5208% +/- 17.0525%
        (Student's t, pooled s = 10.6785)

patched:
    N           Min           Max        Median           Avg        Stddev
x  10         58.38         59.15         58.86        58.847    0.22504567
+  10         59.71         60.79        60.135        60.179    0.29957192
Difference at 95.0% confidence
        1.332 +/- 0.248939
        2.2635% +/- 0.426506%
        (Student's t, pooled s = 0.264942)

system time:

HEAD:
    N           Min           Max        Median           Avg        Stddev
x  10       1010.15       1073.31      1025.465      1031.524     18.135705
+  10       2277.96       6948.53       2949.47      3341.492     1385.2677
Difference at 95.0% confidence
        2309.97 +/- 920.443
        223.937% +/- 89.3039%
        (Student's t, pooled s = 979.616)

patched:
    N           Min           Max        Median           Avg        Stddev
x  10       1010.15       1073.31      1025.465      1031.524     18.135705
+  10        1038.7       1081.06      1070.555      1064.017      15.85404
Difference at 95.0% confidence
        32.493 +/- 16.0042
        3.15% +/- 1.5794%
        (Student's t, pooled s = 17.0331)

Reviewed by: jeff@
Approved by: sbruno@
Differential Revision: https://reviews.freebsd.org/D15155

6 years agoAdd support for the TestStateID operation to the NFSv4.1 server.
Rick Macklem [Fri, 11 May 2018 22:16:23 +0000 (22:16 +0000)]
Add support for the TestStateID operation to the NFSv4.1 server.

The Linux client now uses the TestStateID operation, so this patch adds
support for it to the NFSv4.1 server. The FreeBSD client never uses this
operation, so it should not be affected.

MFC after: 2 months

6 years agosh: Test that backslash-newline within single-quotes is not special
Jilles Tjoelker [Fri, 11 May 2018 21:56:01 +0000 (21:56 +0000)]
sh: Test that backslash-newline within single-quotes is not special

This works correctly, but the test may be helpful when modifying the parser.

6 years agoFix LORs in in6?_leave_group()
Stephen Hurd [Fri, 11 May 2018 21:42:27 +0000 (21:42 +0000)]
Fix LORs in in6?_leave_group()

r333175 updated the join_group functions, but not the leave_group ones.

Reviewed by: sbruno
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15393

6 years agoRemove dead declaration.
Konstantin Belousov [Fri, 11 May 2018 20:47:45 +0000 (20:47 +0000)]
Remove dead declaration.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agoiflib(9): Add support for cloning pseudo interfaces
Matt Macy [Fri, 11 May 2018 20:08:28 +0000 (20:08 +0000)]
iflib(9): Add support for cloning pseudo interfaces

Part 3 of many ...
The VPC framework relies heavily on cloning pseudo interfaces
(vmnics, vpc switch, vcpswitch port, hostif, vxlan if, etc).

This pulls in that piece. Some ancillary changes get pulled
in as a side effect.

Reviewed by: shurd@
Approved by: sbruno@
Sponsored by: Joyent, Inc.
Differential Revision: https://reviews.freebsd.org/D15347

6 years agoFix mld6query(8) and add a new -g option
Stephen Hurd [Fri, 11 May 2018 19:37:18 +0000 (19:37 +0000)]
Fix mld6query(8) and add a new -g option

The mld6query command relies on KAME behaviour which allows the
ipv6mr_multiaddr member of the request object in a IPV6_JOIN_GROUP
setsockopt() call to be INADDR6_ANY. The FreeBSD stack doesn't allow
this, so mld6query has been non-functional.

Also, add a -g option which sends a General Query (query INADDR6_ANY)

Reviewed by: sbruno, mmacy
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15384

6 years agoepoch(9): always set inited in epoch_init
Matt Macy [Fri, 11 May 2018 18:37:14 +0000 (18:37 +0000)]
epoch(9): always set inited in epoch_init

- set inited in the !usedomains case

Reported by: jhibbits
Approved by: sbruno

6 years agovxge(4): deprecation notice
Sean Bruno [Fri, 11 May 2018 17:26:59 +0000 (17:26 +0000)]
vxge(4): deprecation notice

This hardware isn't totally ancient, about equal to a mxge(4) or mlx4en(4),
but the company was sold to Exar which then promptly exited the Ethernet
business so the card was commercially available for under 2 years. On deep
search, the only usage of these cards I found was by the importing of the
driver. There are code quality issues identified by Brooks and Hiren and
no visible use nor maintainership that warrant removal from FreeBSD 12.0.

Submitted by: kbowling
Reviewed by: gnn brooks
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15363

6 years agoRevert r333496.
Bryan Drewery [Fri, 11 May 2018 17:24:04 +0000 (17:24 +0000)]
Revert r333496.

I didn't put the correct paths, nor lib32, and I may have been comparing
against the wrong source tree.

6 years agoApply the change from r272770 to if_ipsec(4) interface.
Andrey V. Elsukov [Fri, 11 May 2018 16:50:25 +0000 (16:50 +0000)]
Apply the change from r272770 to if_ipsec(4) interface.

It is guaranteed that if_ipsec(4) interface is used only for tunnel
mode IPsec, i.e. decrypted and decapsultaed packet has its own IP header.
Thus we can consider it as new packet and clear the protocols flags.
This allows ICMP/ICMPv6 properly handle errors that may cause this packet.

PR: 228108
MFC after: 1 week

6 years agoAdd a bunch of orphaned libraries.
Bryan Drewery [Fri, 11 May 2018 16:46:52 +0000 (16:46 +0000)]
Add a bunch of orphaned libraries.

MFC after: 3 days

6 years agoStrip trailing / from TESTSDIR
Ed Maste [Fri, 11 May 2018 16:11:24 +0000 (16:11 +0000)]
Strip trailing / from TESTSDIR

Otherwise makefs gets upset:
makefs: ./usr/tests/sys/cddl/zfs/tests/exec/: empty leaf element

Sponsored by: The FreeBSD Foundation

6 years agoImprove development(7):
Edward Tomasz Napierala [Fri, 11 May 2018 15:11:53 +0000 (15:11 +0000)]
Improve development(7):

 - Use Fx when referring to FreeBSD.
 - Use Ql instead of Cm for command invocations.
 - Remove some redundant Pp macros.
 - Use a literal indented Bd instead of a series of Dl macros.

Submitted by: 0mp@
Reviewed by: eadler@
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D15126

6 years agoSet kldxref_enable="YES" for ARM images. Without it, the images are missing
Edward Tomasz Napierala [Fri, 11 May 2018 14:52:35 +0000 (14:52 +0000)]
Set kldxref_enable="YES" for ARM images. Without it, the images are missing
the /boot/kernel/linker.hints file, which breaks loading some of the modules
with dependencies, eg cfiscsi.ko.

This is a minimal fix for ARM images, in order to safely MFC it before
11.2-RELEASE.  Afterwards, however, I believe we should actually just change
the default (as in, etc/defaults/rc.conf).  The reason is that it's required
for every image that's being cross-built, as kldxref(1) cannot handle files
for non-native architectures.  For the one that is not - amd64 - having it
on by default doesn't change anything - the script is noop if the linker.hints
already exists.

The long-term solution would be to rewrite kldxref(1) to handle other
architectures, and generate linker.hints at build time.

Reviewed by: gjb@
MFC after: 3 days
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14534

6 years agoClear out the entire structure, not just the size of a pointer to it.
Kenneth D. Merry [Fri, 11 May 2018 14:50:26 +0000 (14:50 +0000)]
Clear out the entire structure, not just the size of a pointer to it.

sys/dev/ocs/ocs_os.c:
In ocs_thread_create(), use sizeof(*thread) (instead of
sizeof(thread)) as the size argument to memset so that we clear
out the entire thread structure instead of just a few bytes of it.

Submitted by: jtl
MFC after: 3 days

6 years agoMake /etc/rc.d/kldxref not print anything for directories that don't
Edward Tomasz Napierala [Fri, 11 May 2018 14:43:21 +0000 (14:43 +0000)]
Make /etc/rc.d/kldxref not print anything for directories that don't
contain any kernel modules.  This makes the common case completely silent,
as it should be.

Reviewed by: imp@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14694