]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoAdd deprecation notices for gdb and kgdb.
jhb [Wed, 5 Jul 2017 15:23:30 +0000 (15:23 +0000)]
Add deprecation notices for gdb and kgdb.

Even though gdb and kgdb may not be removed for 12.0 on some architectures,
the notice is unconditional as these tools will likely be removed at some
point in the future when adequate replacements are available (gdb in ports
or lldb in base).

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11477

6 years agoAdd option to bsdinstall to disable insecure console, update stack guard option
robak [Wed, 5 Jul 2017 13:37:27 +0000 (13:37 +0000)]
Add option to bsdinstall to disable insecure console, update stack guard option

This patch adds new bsdinstall option to hardening section that allows users
to change this behaviour to secure one and updates stack guard option so it
would set the value of relevant sysctl to 512 (2MB)

Submitted by: Bartek Rutkowski
Reviewed by: adrian, bapt, emaste
Approved by: bapt, emaste
MFC after: 1 day
Sponsored by: Pixeware LTD
Differential Revision: https://reviews.freebsd.org/D9700

6 years agoSort entries in libgcc_s Version.map
emaste [Wed, 5 Jul 2017 13:13:38 +0000 (13:13 +0000)]
Sort entries in libgcc_s Version.map

6 years agoCosmetic tweaks to the default shell rc files, mostly comments.
trasz [Wed, 5 Jul 2017 13:08:07 +0000 (13:08 +0000)]
Cosmetic tweaks to the default shell rc files, mostly comments.

MFC after: 2 weeks

6 years agoUse more canonical .Dt for vt(4).
trasz [Wed, 5 Jul 2017 10:43:27 +0000 (10:43 +0000)]
Use more canonical .Dt for vt(4).

MFC after: 2 weeks

6 years agoRun "resizewin -z" from the default shell profile files. This makes
trasz [Wed, 5 Jul 2017 10:37:37 +0000 (10:37 +0000)]
Run "resizewin -z" from the default shell profile files. This makes
the terminal work properly out of the box when logging over a serial
line, which is quite important for the user experience on boards like
Raspberry Pi.  It doesn't affect cases where the terminal size is
already non-zero, such as SSH or vt(4) sessions.

Note that this doesn't handle a scenario pointed out by rgrimes@:
when the terminal is resized after login, the terminal size won't
get updated even after logging out and back in.

Reviewed by: imp
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10642

6 years agoMake MULTIDELAY a requirement in the MPCore Timer driver when using
andrew [Wed, 5 Jul 2017 10:29:05 +0000 (10:29 +0000)]
Make MULTIDELAY a requirement in the MPCore Timer driver when using
PLATFORM. This will help with removing the MULTIDELAY option, enabling
it when PLATFORM is enabled.

6 years agoRequire the ARM Generic Timer driver is built for MULTIDELAY on 32bit arm.
andrew [Wed, 5 Jul 2017 09:27:18 +0000 (09:27 +0000)]
Require the ARM Generic Timer driver is built for MULTIDELAY on 32bit arm.
As this driver is also used for DELAY on arm64 we need to keep the existing
DELAY code for it to use.

6 years agoIn open_binary_fd: when using buffer size for strl* and snprintf,
delphij [Wed, 5 Jul 2017 06:12:21 +0000 (06:12 +0000)]
In open_binary_fd: when using buffer size for strl* and snprintf,
always use >= instead of > to avoid truncation.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D11474
MFC after: 3 days

6 years agoDocument supported poollist() (ippool -l) options in usage() and in
cy [Wed, 5 Jul 2017 05:50:36 +0000 (05:50 +0000)]
Document supported poollist() (ippool -l) options in usage() and in
ippool.8 man page.

6 years agolibelftc: bump version, tracking import in r320343
emaste [Wed, 5 Jul 2017 02:58:46 +0000 (02:58 +0000)]
libelftc: bump version, tracking import in r320343

6 years agoRemove an obsolete comment
jhibbits [Wed, 5 Jul 2017 02:20:03 +0000 (02:20 +0000)]
Remove an obsolete comment

This has been wrong for well over a year, we support the full 36-bit
(or more) PA space.

6 years agoAdd a Bugs section that indicates that the nfsuserd doesn't work
rmacklem [Tue, 4 Jul 2017 22:20:30 +0000 (22:20 +0000)]
Add a Bugs section that indicates that the nfsuserd doesn't work
when jails are being used on the system.
It is hoped that the patches in PR#205193 will someday get tested/debugged
so that they can be committed to fix this.

This is a content change.

PR: 205193
MFC after: 2 weeks

6 years agoWhen reporting undefined symbol, note the version, if specified.
kib [Tue, 4 Jul 2017 20:19:36 +0000 (20:19 +0000)]
When reporting undefined symbol, note the version, if specified.

Use the standard syntax of name@version, I do not expect a confusion
due to unlikely possibility of the name containing the '@' character.

Requested by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agocam: EOL whitespace cleanup and line wrapping changes
emaste [Tue, 4 Jul 2017 18:48:08 +0000 (18:48 +0000)]
cam: EOL whitespace cleanup and line wrapping changes

NFC. This cleanup simplifies diffs for review of the MMC-CAM work.

Submitted by: kibab

6 years agoInvoke suspend/resume methods from the driver pmops if available.
markj [Tue, 4 Jul 2017 18:44:14 +0000 (18:44 +0000)]
Invoke suspend/resume methods from the driver pmops if available.

Obtained from: kmacy (original version)
MFC after: 1 week

6 years agoAdd a driver for the imx6 on-chip realtime clock.
ian [Tue, 4 Jul 2017 18:38:34 +0000 (18:38 +0000)]
Add a driver for the imx6 on-chip realtime clock.

This driver is standard rather than optional because it can always provide
time after a reboot, but it will only provide time after a power cycle if
battery power is supplied to the chip's SNVS power domain.

6 years agoMove to open state after plausibility checks.
tuexen [Tue, 4 Jul 2017 18:24:50 +0000 (18:24 +0000)]
Move to open state after plausibility checks.

When doing this too early, the MIB counters go wrong.

MFC after: 1 week

6 years agoAfter r319722 two fields were left uninitialized when transforming a
hselasky [Tue, 4 Jul 2017 18:23:17 +0000 (18:23 +0000)]
After r319722 two fields were left uninitialized when transforming a
socket structure into a listening socket. This resulted in an invalid
instruction fault for all 32-bit platforms.

When INVARIANTS is set the union where the two uninitialized fields
reside gets properly zeroed. This patch ensures the two uninitialized
fields are zeroed when INVARIANTS is undefined.

For 64-bit platforms this issue was not visible because so->sol_upcall
which is uninitialized overlaps with so->so_rcv.sb_state which is
already zero during soalloc();

For 32-bit platforms this issue was visible and resulted in an invalid
instruction fault, because so->sol_upcall overlaps with
so->so_rcv.sb_sel which is always initialized to a valid data pointer
during soalloc().

Verifying the offset locations mentioned above are identical is left
as an exercise to the reader.

PR: 220452
PR: 220358
Reviewed by: ae (network), gallatin
Differential Revision: https://reviews.freebsd.org/D11475
Sponsored by: Mellanox Technologies

6 years agoMove the simple armv6 only timer drivers to require MULTIDELAY to help
andrew [Tue, 4 Jul 2017 18:07:09 +0000 (18:07 +0000)]
Move the simple armv6 only timer drivers to require MULTIDELAY to help
move all armv6 configs it.

6 years agoDon't hold if refcount on an stcb when it is not needed.
tuexen [Tue, 4 Jul 2017 18:04:44 +0000 (18:04 +0000)]
Don't hold if refcount on an stcb when it is not needed.
This improves the consistency with other parts of the code.

6 years agoAdd a delay count to the last few places. This will help make MULTIDELAY
andrew [Tue, 4 Jul 2017 17:15:23 +0000 (17:15 +0000)]
Add a delay count to the last few places. This will help make MULTIDELAY
a requirement on armv6 with PLATFORM.

6 years agoRemove PLATFORM_SMP. It's unneeded as all configs with both PLATFORM and
andrew [Tue, 4 Jul 2017 16:52:55 +0000 (16:52 +0000)]
Remove PLATFORM_SMP. It's unneeded as all configs with both PLATFORM and
SMP use it so we can switch to the combination of these as the check.

6 years agoAdd deprecation notices for all rcmd tools
allanjude [Tue, 4 Jul 2017 15:44:30 +0000 (15:44 +0000)]
Add deprecation notices for all rcmd tools

Submitted by: bcr
Reviewed by: emaste, bapt, jhl
MFC after: immediate
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11471

6 years agoAdd PLATFORM and PLATFORM_SMP support to the ALPINE kernel configuration.
andrew [Tue, 4 Jul 2017 12:26:47 +0000 (12:26 +0000)]
Add PLATFORM and PLATFORM_SMP support to the ALPINE kernel configuration.
This will help move it to be part of GENERIC.

6 years agoTeach VERSATILEPB about PLATFORM. This will help move it into the GENERIC
andrew [Tue, 4 Jul 2017 12:17:49 +0000 (12:17 +0000)]
Teach VERSATILEPB about PLATFORM. This will help move it into the GENERIC
kernel configuration.

6 years agortwn_usb: reject too long (>16K) mbufs.
avos [Tue, 4 Jul 2017 07:07:08 +0000 (07:07 +0000)]
rtwn_usb: reject too long (>16K) mbufs.

While here move RTWN_TXBUFSZ constant from common to USB specific code
(it's not used anywhere else).

6 years agoAdd some auxiliary types for device driver support.
markj [Tue, 4 Jul 2017 01:23:36 +0000 (01:23 +0000)]
Add some auxiliary types for device driver support.

MFC after: 1 week

6 years agoAdd a field for the class code to struct pci_driver.
markj [Tue, 4 Jul 2017 01:05:20 +0000 (01:05 +0000)]
Add a field for the class code to struct pci_driver.

Fill out some previously uninitialized fields as well.

MFC after: 1 week

6 years agoAdd some PCI class definitions.
markj [Tue, 4 Jul 2017 00:48:50 +0000 (00:48 +0000)]
Add some PCI class definitions.

MFC after: 1 week

6 years agoRename the "driver" field to "bsddriver" to avoid a name collision.
markj [Tue, 4 Jul 2017 00:30:48 +0000 (00:30 +0000)]
Rename the "driver" field to "bsddriver" to avoid a name collision.

MFC after: 1 week

6 years agoReplace mbuf defragmentation with collapse
zbb [Tue, 4 Jul 2017 00:10:29 +0000 (00:10 +0000)]
Replace mbuf defragmentation with collapse

Collapse should be more effective than defragmentation.
Added missing declaration of ena_check_and_collapse_mbuf().

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

6 years agoFix creation of dma tags and TSO settings
zbb [Tue, 4 Jul 2017 00:08:47 +0000 (00:08 +0000)]
Fix creation of dma tags and TSO settings

TSO settings were not reflecting real HW capabilities.

DMA tags were created with wrong window - high address was the same as
low, so excluding window was not working.

Capabilities of TX dma transaction were not set properly - TSO max size
had been increased and size of one segment had been adjusted.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

6 years agoRemove RX mtx from ENA driver
zbb [Tue, 4 Jul 2017 00:06:56 +0000 (00:06 +0000)]
Remove RX mtx from ENA driver

RX lock is no longer required. There can only be one RX cleanup task
running at a time, RX cleanup cannot be executed if interface is not
yet initialized and ena_down() will not free any RX resources if any io
interrupt is being handled - RX cleanup task is only called from an
interrupt handler.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

6 years agoCall drbr_advance() before leaving TX routine
zbb [Tue, 4 Jul 2017 00:04:31 +0000 (00:04 +0000)]
Call drbr_advance() before leaving TX routine

If drbr_advance() is not called before doing cleanup and packet is
already enqueued for sending (tx_info is holding pointer to mbuf), then
mbuf is cleaned both in drbr_flush() and in cleanup routine, when all
mbufs hold by tx_buffer_info are being released.

This causes panic, because mbuf is released twice.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

6 years agoUnmask all IO irqs after driver state is set as running
zbb [Tue, 4 Jul 2017 00:02:28 +0000 (00:02 +0000)]
Unmask all IO irqs after driver state is set as running

If driver left MSI-x handlling routine because interface was put down,
it is not unmasking IRQs, so any requesting interrupt will be awaiting
for unmasking.

On ena_up() routine all interrupts are being unmasked and any awaiting
interrupt will be handled right away.

If handler was executed before driver state was set as running, handling
routine is being ended immediately, leaving IO irqs for given queue
masked.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

6 years agoHold the PCI device list lock when removing an element.
markj [Tue, 4 Jul 2017 00:02:06 +0000 (00:02 +0000)]
Hold the PCI device list lock when removing an element.

MFC after: 1 week

6 years agoAcquire locks before calling drbr_flush()
zbb [Tue, 4 Jul 2017 00:00:42 +0000 (00:00 +0000)]
Acquire locks before calling drbr_flush()

It is required to hold lock that is associated with buffer ring before
flushing drbr.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

6 years agoAdd missing lock upon initialization of the interface
zbb [Mon, 3 Jul 2017 23:59:11 +0000 (23:59 +0000)]
Add missing lock upon initialization of the interface

Lack of this lock was causing crash if down was called in
parallel with the initialization routine.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

6 years agoFix a few issues with the lockstat provider man page.
markj [Mon, 3 Jul 2017 23:54:39 +0000 (23:54 +0000)]
Fix a few issues with the lockstat provider man page.

- Address most of the post-commit comments on D11128.[1]
- Reference the man pages for the lock types supported by the provider.
- Add a BUGS section.
- Eliminate some redundancy by describing similar probes in the same
  paragraph.
- Fix several inaccuracies, particularly in the probe argument
  descriptions.

Submitted by: wblock [1]
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11293

6 years agoUpdate jemalloc to 5.0.1.
jasone [Mon, 3 Jul 2017 23:27:57 +0000 (23:27 +0000)]
Update jemalloc to 5.0.1.

6 years agoCorrect a typo in the comment part of r320577, later on copied into
marius [Mon, 3 Jul 2017 20:47:32 +0000 (20:47 +0000)]
Correct a typo in the comment part of r320577, later on copied into
the commit message; as actually implemented, the intent is to retry
up to 2 ms for controllers to enable bus power.
Noticed by: ian@, rgrimes@

Additional note: Among others, the problem addressed by r320577 is
the APL32 ("Storage Controllers May Not Be Power Gated") erratum.
Hopefully, along with r318282, r320577 works around the remaining
problems seen with Intel Apollo Lake eMMC and SDXC controllers.

6 years agoResolve confusion between different error code spaces.
kib [Mon, 3 Jul 2017 20:44:01 +0000 (20:44 +0000)]
Resolve confusion between different error code spaces.

The vm_map_fixed() and vm_map_stack() VM functions return Mach error
codes.  Convert them into errno values before returning result from
exec_new_vmspace().

While there, modernize the comment and do minor style adjustments.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoAllow rtadvd and bsnmpd to run in vnet jails
kp [Mon, 3 Jul 2017 20:36:58 +0000 (20:36 +0000)]
Allow rtadvd and bsnmpd to run in vnet jails

Both of these tools are usable in vnet jails, so allow them to run there.

PR: 220431, 220432
Submitted by: olivier@freebsd.org

6 years agoClear clang warning:
sbruno [Mon, 3 Jul 2017 19:49:25 +0000 (19:49 +0000)]
Clear clang warning:
  warning: macro expansion producing 'defined' has undefined behavior
  [-Wexpansion-to-defined]

Submitted by: Aaron Prieger <aprieger@llnw.com>
Reviewed by: dim
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11166

6 years agoAdd a sysctl to toggle the use of the sockets LOWAT when calculating auto window...
sbruno [Mon, 3 Jul 2017 19:39:58 +0000 (19:39 +0000)]
Add a sysctl to toggle the use of the sockets LOWAT when calculating auto window growth

Submitted by: j@nitrology.com (Jason Wolfe)
Reviewed by: gnn hiren
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11016

6 years agoGarbage collect kernel option TWA_FLASH_FIRMWARE
sbruno [Mon, 3 Jul 2017 19:33:50 +0000 (19:33 +0000)]
Garbage collect kernel option TWA_FLASH_FIRMWARE

Submitted by:  kevin.bowling0kev009.com
Differential Revision: https://reviews.freebsd.org/D11387

6 years agoallwinner: Add A64 ccung support
manu [Mon, 3 Jul 2017 19:30:03 +0000 (19:30 +0000)]
allwinner: Add A64 ccung support

Upstream DTS for A64 SoC doesn't provide a /clocks node as Linux switched
to ccu-ng
This commit adds the necessary bits to boot on pine64 with latest DTS from
upstream.
USB is not working for now and some node aren't present in the DTS (like the
PMU, Power Management Unit).

Tested on: Pine64

6 years agoiflib - flib_busdma_load_mbuf_sg used isc_tx_maxsize as max semgent size.
sbruno [Mon, 3 Jul 2017 19:23:45 +0000 (19:23 +0000)]
iflib - flib_busdma_load_mbuf_sg used isc_tx_maxsize as max semgent size.

Submitted by: krzysztof.galazka@intel.com
Differential Revision: https://reviews.freebsd.org/D11403

6 years agobnxt(4) Enable LRO support, redux
sbruno [Mon, 3 Jul 2017 18:23:35 +0000 (18:23 +0000)]
bnxt(4) Enable LRO support, redux

iflib - reset fl-ifl_fragidx to 0 on iflib_fl_bufs_free().  This caused the
panic in em/igb when adding it to a bridge device.

iflib - Handle out of order packet delivery from hardware in support of LRO

Out of order updates to rxd's is fixed in r315217. However, it is not
completely fixed.  While refilling the buffers, iflib is not considering
the out of order descriptors. Hence, it is refilling sequentially.
"idx" variable in _iflib_fl_refill routine is incremented sequentially.
By doing refilling sequentially, it will override the SGEs that
are *IN USE* by other connections.  Fix is to maintain a bitmap of
rx descriptors and differentiate the used one with unused one and
refill only at the unused indices.  This patch also fixes a
few bugs in bnxt, related to the same feature.

Submitted by: bhargava.marreddy@broadcom.com
Reviewed by: venkatkumar.duvvuru@broadcom.com shurd
Differential Revision: https://reviews.freebsd.org/D10681

6 years agoarm: gic: Change GIC_DEBUG_SPURIOUS to TUNABLE
manu [Mon, 3 Jul 2017 18:01:58 +0000 (18:01 +0000)]
arm: gic: Change GIC_DEBUG_SPURIOUS to TUNABLE

On armv6 default to 1 if INVARIANTS is set
On arm64 always default to 0

Discussed with: andrew, ian, mmel

6 years agoSwitch fabric scans from GID_FT to GID_PT+GFF_ID/GFT_ID.
mav [Mon, 3 Jul 2017 15:56:45 +0000 (15:56 +0000)]
Switch fabric scans from GID_FT to GID_PT+GFF_ID/GFT_ID.

Instead of using GID_FT SNS request to get list of registered FCP ports,
use GID_PT to get list of all Nx_Ports, and then use GFF_ID and/or GFT_ID
requests to find whether they are FCP and target capable.

The problem with old approach is that GID_FT does not report ports without
FC-4 type registered.  In particular it was impossible to boot OS from
FreeBSD FC target using QLogic FC BIOS, since one does not register FC-4
type even on new cards and so ignored by old code as incompatible.

As a side bonus this allows initiator to skip pointless logins to other
initiators by fetching that information from SNS instead.

In case some switches do not implement GFF_ID/GFT_ID correctly, add sysctls
to disable that functionality.  I handled broken GFF_ID of my Brocade 200E,
but there may be other switches with different bugs.

Linux also uses GID_PT, but GFF_ID is disabled by default there, and GFT_ID
is not supported.

Sponsored by: iXsystems, Inc.

6 years agoed(1): Allow the omission of one address in (.,.) and (.;.) address ranges
pfg [Mon, 3 Jul 2017 15:54:44 +0000 (15:54 +0000)]
ed(1): Allow the omission of one address in (.,.) and (.;.) address ranges

With this patch, ",n" is an abbreviation for "1,n", ";n" abbreviates
".;n". The "n," and "n;" variants mean "n,n" and "n;n", respectively.
Also, piping to a shell command does not count as a save, so don't reset
the modified flag.

Obtained from: OpenBSD (CVS Rev. 1.58, 1.59)

6 years agoFix Vagrant image upload after recent API changes.
gjb [Mon, 3 Jul 2017 14:31:38 +0000 (14:31 +0000)]
Fix Vagrant image upload after recent API changes.

- Update ATLAS_UPLOAD_URL to avoid various regular expressions
  from failing to match due to redirections.
- Use ATLAS_UPLOAD_URL throughout the script.
- Adjust several regular expression patterns.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoAdd support for musl consumers to the Linuxulator.
dchagin [Mon, 3 Jul 2017 10:24:49 +0000 (10:24 +0000)]
Add support for musl consumers to the Linuxulator.

PR: 213809
Submitted by: Yonas Yanfa
Reported by: Yonas Yanfa
MFC after: 1 week
Relnotes: yes

6 years agoLet io_mapping_init_wc() fall back to an uncacheable mapping.
markj [Mon, 3 Jul 2017 02:01:16 +0000 (02:01 +0000)]
Let io_mapping_init_wc() fall back to an uncacheable mapping.

This allows usage of the function on architectures that don't support
write-combining.

Reported by: bz, emaste
X-MFC With: r320196

6 years agopatch(1): add support for git generated diffs.
pfg [Sun, 2 Jul 2017 21:00:30 +0000 (21:00 +0000)]
patch(1): add support for git generated diffs.

Sometimes patches coming from other places have extra a/ and b/
directories prepended to filenames.

Obtained from: OpenBSD (CVS rev. 1.57, 1.58)

6 years agoext2fs: be more verbose about unsupported ext2fs features.
pfg [Sun, 2 Jul 2017 20:47:25 +0000 (20:47 +0000)]
ext2fs: be more verbose about unsupported ext2fs features.

It is useful to know exactly what features may be lacking when trying to
mount ext4 filesystems.

Submitted by: Fedor Uporov
Differential Revision: https://reviews.freebsd.org/D11208

6 years agoRetry up to 20 ms to enable bus power as at least with some Intel
marius [Sun, 2 Jul 2017 19:13:01 +0000 (19:13 +0000)]
Retry up to 20 ms to enable bus power as at least with some Intel
SDHCI/eMMC controllers the first attempt after a D3 to D0 transition,
i. e. when the firmware has put the devices into D3 state before,
can fail.

6 years agodiskinfo(8): correct typo in man page
allanjude [Sun, 2 Jul 2017 16:20:49 +0000 (16:20 +0000)]
diskinfo(8): correct typo in man page

Reported by: N.J. Mann <njm@njm.me.uk>

6 years agoMove comment respecting previous commit.
mav [Sun, 2 Jul 2017 15:08:32 +0000 (15:08 +0000)]
Move comment respecting previous commit.

6 years agoSlightly unify SNS requests for post- and pre-24xx.
mav [Sun, 2 Jul 2017 14:59:41 +0000 (14:59 +0000)]
Slightly unify SNS requests for post- and pre-24xx.

6 years agoIn the arm64 pmap_remove, when removing a full superpage there is no need
andrew [Sun, 2 Jul 2017 08:52:08 +0000 (08:52 +0000)]
In the arm64 pmap_remove, when removing a full superpage there is no need
to demote it to 512 pages, then remove each of these. We can just remove
the l2 map directly. This is what the intel pmaps already do.

Sponsored by: DARPA, AFRL

6 years agoCorrect signatures of several pthreads stubs.
kib [Sun, 2 Jul 2017 05:40:22 +0000 (05:40 +0000)]
Correct signatures of several pthreads stubs.

Most important, use a correct signature for the
__pthread_cleanup_push_imp() stub, which was incorrectly generated
with two-args variant.  The pthread_cleanup_info pointer was corrupted
in the forwarded call to the real libthr implementation, visible on
PowerPC and possibly ARM. [1]

Found and tested by: Mark Millard <markmi@dsl-only.net> [1]
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agorwlock: perform the typically false td_rw_rlocks check later
mjg [Sun, 2 Jul 2017 01:05:16 +0000 (01:05 +0000)]
rwlock: perform the typically false td_rw_rlocks check later

Check if the lock is available first instead.

MFC after: 1 week

6 years agoModify vm_map_growstack() to protect itself from the possibility of the
alc [Sat, 1 Jul 2017 23:39:49 +0000 (23:39 +0000)]
Modify vm_map_growstack() to protect itself from the possibility of the
gap entry in the vm map being smaller than the sysctl-derived stack guard
size.  Otherwise, the value of max_grow can suffer from overflow, and the
roundup(grow_amount, sgrowsiz) will not be properly capped, resulting in
an assertion failure.

In collaboration with: kib
MFC after: 3 days

6 years agoPort PowerPC kqueue(2) compat32 fix in r320500 to MIPS.
kib [Sat, 1 Jul 2017 22:52:17 +0000 (22:52 +0000)]
Port PowerPC kqueue(2) compat32 fix in r320500 to MIPS.

All 32bit MIPS ABIs align uint64_t on 8-byte.  Since struct kevent32
is defined using 32bit types to avoid extra alignment on amd64/i386,
layout of the structure needs paddings on PowerPC and apparently MIPS.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D11434

6 years agoAdd -s (serial) and -p (physpath) to diskinfo
allanjude [Sat, 1 Jul 2017 21:34:57 +0000 (21:34 +0000)]
Add -s (serial) and -p (physpath) to diskinfo

Return the bare requested information, intended for scripting.

The serial number of a SAS/SCSI device can be returned with
'camcontrol inquiry disk -S', but there is no similar switch for SATA.

This provides a way to get this information from both SAS and SATA disks

the -s and -p flags are mutually exclusive, and cannot be used with any
other flags.

Reviewed by: rpokala, wblock
MFC after: 1 month
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D7828

6 years agoIncrease loop unrolling for skein hashes
allanjude [Sat, 1 Jul 2017 21:18:06 +0000 (21:18 +0000)]
Increase loop unrolling for skein hashes

This patch was inspired by an opposite change made to shrink the code
for the boot loader.

On my i7-4770, it increases the skein1024 speed from 470 to 550 MB/s

Reviewed by: sbruno
MFC after: 1 month
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D7824

6 years agoInteger underflow in efipart_realstrategy when I/O starts after end of disk
allanjude [Sat, 1 Jul 2017 20:25:22 +0000 (20:25 +0000)]
Integer underflow in efipart_realstrategy when I/O starts after end of disk

This fixes an integer underflow in efipart_realstrategy, which causes
crashes when an I/O operation's start point is after the end of the disk.
This can happen when trying to detect filesystems on very small disks.
This can occur if a BIOS freebsd-boot partition exists on a system when the
EFI loader is being used.

PR: 219000
Submitted by: Eric McCorkle <eric@metricspace.net>
Reviewed by: cem (previous version), tsoome (previous version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D10559

6 years agoDo not build clang for all riscv*, not just riscv64
emaste [Sat, 1 Jul 2017 19:10:59 +0000 (19:10 +0000)]
Do not build clang for all riscv*, not just riscv64

Previous test matching on "riscv64" was invalidated by the addition of
riscv64sf.

Sponsored by: The FreeBSD Foundation

6 years agoLink EFI/uboot loaders with -znotext
emaste [Sat, 1 Jul 2017 18:48:15 +0000 (18:48 +0000)]
Link EFI/uboot loaders with -znotext

By default LLD links with relocations disallowed against readonly
sections (e.g., .text), but the 32-bit ARM EFI & uboot boot bits require
such relocations. -znotext is either ignored as an unknown -z option
(in-tree lld 2.17.50) or is already the default (GNU ld or GNU gold from
ports) so we can just add it unconditionally to allow building with LLD.

This is similar to the change in r320179 for the kernel link.

Sponsored by: The FreeBSD Foundation

6 years agoWhen "force" is specified to pmap_invalidate_cache_range(), the given
alc [Sat, 1 Jul 2017 16:42:09 +0000 (16:42 +0000)]
When "force" is specified to pmap_invalidate_cache_range(), the given
start address is not required to be page aligned.  However, the loop
within pmap_invalidate_cache_range() that performs the actual cache
line invalidations requires that the starting address be truncated to
a multiple of the cache line size.  This change corrects an error in
that truncation.

Submitted by: Brett Gutstein <bgutstein@rice.edu>
Reviewed by: kib
MFC after: 1 week

6 years agoBump __FreeBSD_version due to r320528, cleanup and inlining of
jah [Sat, 1 Jul 2017 15:58:57 +0000 (15:58 +0000)]
Bump __FreeBSD_version due to r320528, cleanup and inlining of
bus_dmamap* functions.

Reported by: David Wolfskill <david@catwhisker.org>

6 years agoDisable RCMDS by default.
jlh [Sat, 1 Jul 2017 10:04:42 +0000 (10:04 +0000)]
Disable RCMDS by default.

This was announced in this thread:
https://lists.freebsd.org/pipermail/freebsd-arch/2017-June/018239.html

Applying plan proposed by ngie@ in:
https://lists.freebsd.org/pipermail/freebsd-arch/2017-June/018249.html

The port has been submitted as net/bsdrcmds in r444814.

Approved by: bapt, roberto, and others

6 years agoRemove all calls to cpu_dcache_wb_range from the arm64 pmap code. These
andrew [Sat, 1 Jul 2017 09:38:52 +0000 (09:38 +0000)]
Remove all calls to cpu_dcache_wb_range from the arm64 pmap code. These
were unneeded as we tell the tlb the pagetables are in cached memory. This
gives us a small, but statistically significant improvement over just
removing the PTE_SYNC cases.

While here remove PTE_SYNC, it's now unneeded.

Sponsored by: DARPA, AFRL

6 years agoClean up MD pollution of bus_dma.h:
jah [Sat, 1 Jul 2017 05:35:29 +0000 (05:35 +0000)]
Clean up MD pollution of bus_dma.h:

--Remove special-case handling of sparc64 bus_dmamap* functions.
  Replace with a more generic mechanism that allows MD busdma
  implementations to generate inline mapping functions by
  defining WANT_INLINE_DMAMAP in <machine/bus_dma.h>.  This
  is currently useful for sparc64, x86, and arm64, which all
  implement non-load dmamap operations as simple wrappers
  around map objects which may be bus- or device-specific.

--Remove NULL-checked bus_dmamap macros.  Implement the
  equivalent NULL checks in the inlined x86 implementation.
  For non-x86 platforms, these checks are a minor pessimization
  as those platforms do not currently allow NULL maps.  NULL
  maps were originally allowed on arm64, which appears to have
  been the motivation behind adding arm[64]-specific barriers
  to bus_dma.h, but that support was removed in r299463.

--Simplify the internal interface used by the bus_dmamap_load*
  variants and move it to bus_dma_internal.h

--Fix some drivers that directly include sys/bus_dma.h
  despite the recommendations of bus_dma(9)

Reviewed by: kib (previous revision), marius
Differential Revision: https://reviews.freebsd.org/D10729

6 years agoChange blst_leaf_alloc() to handle a cursor argument, and to improve
alc [Sat, 1 Jul 2017 05:27:40 +0000 (05:27 +0000)]
Change blst_leaf_alloc() to handle a cursor argument, and to improve
performance.

To find in the leaf bitmap all ranges of sufficient length, use a doubling
strategy with shift-and-and until each bit still set represents a bit
sequence of length 'count', or until the bitmask is zero.  In the latter
case, update the hint based on the first bit sequence length not found to
be available.  For example, seeking an interval of length 12, the set bits
of the bitmap would represent intervals of length 1, then 2, then 3, then
6, then 12.  If no bits are set at the point when each bit represents an
interval of length 6, then the hint can be updated to 5 and the search
terminated.

If long-enough intervals are found, discard those before the cursor.  If
any remain, use binary search to find the position of the first of them,
and allocate that interval.

Submitted by: Doug Moore <dougm@rice.edu>
Reviewed by: kib, markj
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D11426

6 years agoFix sign of resid and add a mostly useless cast to cope with signed vs
imp [Sat, 1 Jul 2017 02:19:48 +0000 (02:19 +0000)]
Fix sign of resid and add a mostly useless cast to cope with signed vs
unsigned check warnings from traditional unix code construsts bogusly
flagged as potentially unsafe.

6 years agoFix functional_test.sh to use --libxo options instead of the deprecated
phil [Fri, 30 Jun 2017 23:53:40 +0000 (23:53 +0000)]
Fix functional_test.sh to use --libxo options instead of the deprecated
LIBXO_OPTIONS environment variable.

Submitted by: phil

6 years agonetfront.c: avoid gcc variably-modified warning
rlibby [Fri, 30 Jun 2017 22:14:22 +0000 (22:14 +0000)]
netfront.c: avoid gcc variably-modified warning

gcc produces a "variably modified X at file scope" warning for
structures that use these size definitions.  I think the definitions are
actually fine but can be rephrased with the __CONST_RING_SIZE macro more
cleanly anyway.

Reviewed by: markj, royger
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential revision: https://reviews.freebsd.org/D11417

6 years agompt.h: macro parenthesization
rlibby [Fri, 30 Jun 2017 22:06:24 +0000 (22:06 +0000)]
mpt.h: macro parenthesization

Build with gcc -Wint-in-bool-context revealed a macro parenthesization
error (invoking mpt_lprt with a ternary expression for level).

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential revision: https://reviews.freebsd.org/D11412

6 years agog_virstor.h: macro parenthesization
rlibby [Fri, 30 Jun 2017 22:01:18 +0000 (22:01 +0000)]
g_virstor.h: macro parenthesization

Build with gcc -Wint-in-bool-context revealed a macro parenthesization
error (invoking LOG_MSG with a ternary expression for lvl).

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential revision: https://reviews.freebsd.org/D11411

6 years agoIn the stdio cleanup push and pop wrappers, always call libc stubs for
kib [Fri, 30 Jun 2017 20:27:51 +0000 (20:27 +0000)]
In the stdio cleanup push and pop wrappers, always call libc stubs for
__pthread_cleanup_push/pop_imp instead of symbols also exported from
libthr.

This prevents calls into libthr if libthr is not yet initialized.  The
situation occurs e.g. when an LD_PRELOADed object is not linked
against libthr, but the main binary is.

Reported and tested by: jbeich
PR:  220381
Discussed with: vangyzen
Sponsored by: The FreeBSD Foundation
MFC after: 13 days

6 years agoFix typo in the r320472 change to fgetws(). Return proper value.
kib [Fri, 30 Jun 2017 20:23:46 +0000 (20:23 +0000)]
Fix typo in the r320472 change to fgetws().  Return proper value.

Reported by: Oleg Ginzburg <olevole@olevole.ru>
Reviewed by: vangyzen
Sponsored by: The FreeBSD Foundation
MFC after: 13 days

6 years agoAdd myself to commiters-src.dot, emaste@ as mentor; sort his mentees while here
kevans [Fri, 30 Jun 2017 20:01:31 +0000 (20:01 +0000)]
Add myself to commiters-src.dot, emaste@ as mentor; sort his mentees while here

Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11429

6 years agoDefault the abort_conf malloc option to false.
jasone [Fri, 30 Jun 2017 17:45:51 +0000 (17:45 +0000)]
Default the abort_conf malloc option to false.

This avoids troublesome backward compatibility issues.

6 years agobsd.linker.mk: add band-aid for linker invocation failure
emaste [Fri, 30 Jun 2017 16:34:17 +0000 (16:34 +0000)]
bsd.linker.mk: add band-aid for linker invocation failure

In some cases bsd.linker.mk reports an error like:

  make[4]: ".../share/mk/bsd.linker.mk" line 56:
  Unknown linker from LD=ld -m elf32ppc_fbsd:"

For now change this to a .warning, and then assume GNU ld 2.17.50.
At present the linker type detection is used only for enabling build-id,
and we can carry on without it when type detection fails.

Also, show errors from ${LD} --version to aid in failure diagnosis.
Successful invocations of ${LD} --version produce no output on stderr
so this will not create any spam in non-failing builds.

Tested by: swills
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11424

6 years agoCorrect fences for sys/refcount.h.
kib [Fri, 30 Jun 2017 16:16:21 +0000 (16:16 +0000)]
Correct fences for sys/refcount.h.

The acq barrier in refcount_acquire() has no use, constructor must
ensure that the changes are visible before publication by other means.
Last release must sync/with the constructor and all updaters.

This is based on the refcount/shared_ptr analysis I heard at the Hans
Boehm and Herb Sutter talks about C++ atomics.

Reviewed by: alc, jhb, markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D11270

6 years agoAmend the layout of kevent32 on powerpc where uint64_t has 8-byte
kib [Fri, 30 Jun 2017 16:12:57 +0000 (16:12 +0000)]
Amend the layout of kevent32 on powerpc where uint64_t has 8-byte
alignment.

Reported,tested and assertion updates by: andreast
Sponsored by: The FreeBSD Foundation

6 years agoDefine ino64_trunc_error under same conditions as the code which uses
kib [Fri, 30 Jun 2017 16:10:21 +0000 (16:10 +0000)]
Define ino64_trunc_error under same conditions as the code which uses
the variable.

Noted by: bde
Sponsored by: The FreeBSD Foundation

6 years agoClear the MAP_WIREFUTURE flag on the vm map in exec_new_vmspace() when it
alc [Fri, 30 Jun 2017 15:49:36 +0000 (15:49 +0000)]
Clear the MAP_WIREFUTURE flag on the vm map in exec_new_vmspace() when it
recycles the current vm space.  Otherwise, an mlockall(MCL_FUTURE) could
still be in effect on the process after an execve(2), which violates the
specification for mlockall(2).

It's pointless for vm_map_stack() to check the MEMLOCK limit.  It will
never be asked to wire the stack.  Moreover, it doesn't even implement
wiring of the stack.

Reviewed by: kib, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11421

6 years agoRemove a blank line accidentally added in r320403.
andrew [Fri, 30 Jun 2017 14:45:43 +0000 (14:45 +0000)]
Remove a blank line accidentally added in r320403.

6 years agoAllow status aggregation for ramdisk reads.
mav [Fri, 30 Jun 2017 07:48:08 +0000 (07:48 +0000)]
Allow status aggregation for ramdisk reads.

6 years agoRevert r300385 and r300624 which was false positive
delphij [Fri, 30 Jun 2017 07:04:10 +0000 (07:04 +0000)]
Revert r300385 and r300624 which was false positive
reported by cppcheck.

dup_ncp() tries to allocate a buffer of MAXNETCONFIGLINE
as tmp, which is then assigned to p->nc_netid via strcpy,
so the free(p->nc_netid) would have correctly released
the memory in case nc_lookups() fails, therefore, the
allerged leak never existed.

MFC after: 3 days

6 years agoUnify INOT/ATIO setup.
mav [Fri, 30 Jun 2017 06:34:49 +0000 (06:34 +0000)]
Unify INOT/ATIO setup.

6 years agoPolish target_id/target_lun setting for ATIOs/INOTs.
mav [Fri, 30 Jun 2017 06:10:18 +0000 (06:10 +0000)]
Polish target_id/target_lun setting for ATIOs/INOTs.

For ATIOs it is pointless to report isp_loopid to CAM, since in other
places it operates with port database record IDs, not with loop IDs.

For INOTs target_id/target_lun seems were never set, so wildcard INOTs
probably were not working correctly when LUN IDs were important.

6 years agoatf-sh(3): document atf_init_test_cases(3) fully
ngie [Fri, 30 Jun 2017 05:49:12 +0000 (05:49 +0000)]
atf-sh(3): document atf_init_test_cases(3) fully

The function was missing from the NAME/SYNOPSIS sections. Add a manpage link
to complete the documentation reference.

MFC after: 1 month

6 years agohyperv/input: Remove unnecessary inclusion.
sephe [Fri, 30 Jun 2017 03:01:22 +0000 (03:01 +0000)]
hyperv/input: Remove unnecessary inclusion.

The unbreaks gcc compilation.

Submitted by: Ryan Libby
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11415

6 years agoUse the more common Book-E idiom for disabling interrupts.
jhibbits [Fri, 30 Jun 2017 02:11:32 +0000 (02:11 +0000)]
Use the more common Book-E idiom for disabling interrupts.

Book-E has the wrteei/wrtee instructions for writing the PSL_EE bit, ignoring
all others.  Use this instead of the AIM-typical mtmsr.

MFC with: r320392