]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoPrefix {TARGET,BUILD}_TRIPLE with LLVM_ to avoid Makefile.inc1 collision.
Bryan Drewery [Wed, 25 Oct 2017 21:45:55 +0000 (21:45 +0000)]
Prefix {TARGET,BUILD}_TRIPLE with LLVM_ to avoid Makefile.inc1 collision.

The Makefile.inc1 TARGET_TRIPLE is for specifying which -target is used
during the build of world.

MFC after: 2 weeks
Reviewed by: dim, imp
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12792

6 years agoEvaluate packet size after the firewall had its chance in the ip6 fast path
Kristof Provost [Wed, 25 Oct 2017 19:21:48 +0000 (19:21 +0000)]
Evaluate packet size after the firewall had its chance in the ip6 fast path

Defer the packet size check until after the firewall has had a look at it. This
means that the firewall now has the opportunity to (re-)fragment an oversized
packet.
This mirrors what the slow path does.

Reviewed by: ae
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D12779

6 years agoloader.efi: Make framebuffer commands available for arm64
Emmanuel Vadot [Wed, 25 Oct 2017 18:55:04 +0000 (18:55 +0000)]
loader.efi: Make framebuffer commands available for arm64

Move framebuffer.{c,h} to sys/boot/efi/loader and add the efifb
related metadata and pass it to the kernel

Reviewed by: imp, andrew
Differential Revision: https://reviews.freebsd.org/D12757

6 years agoEnable i386 build of the Cavium LiquidIO driver (lio) module.
Sean Bruno [Wed, 25 Oct 2017 17:49:17 +0000 (17:49 +0000)]
Enable i386 build of the Cavium LiquidIO driver (lio) module.

Submitted by: pkanneganti@cavium.com (Prasad V Kanneganti)
MFC after: 1 week
Sponsored by: Cavium Networks
Differential Revision: https://reviews.freebsd.org/D12415

6 years agoAdd a test for sending a signal while stepping a thread via PT_STEP.
John Baldwin [Wed, 25 Oct 2017 17:23:33 +0000 (17:23 +0000)]
Add a test for sending a signal while stepping a thread via PT_STEP.

MFC after: 1 week

6 years agoMake drain_output() use bufobj_wwait().
Mark Johnston [Wed, 25 Oct 2017 17:20:18 +0000 (17:20 +0000)]
Make drain_output() use bufobj_wwait().

No functional change intended.

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

6 years agoFix zpool_read_all_labels when vfs.aio.enable_unsafe=0
Alan Somers [Wed, 25 Oct 2017 16:01:19 +0000 (16:01 +0000)]
Fix zpool_read_all_labels when vfs.aio.enable_unsafe=0

Previously, zpool_read_all_labels was trying to do 256KB reads, which are
greater than the default MAXPHYS and therefore must go through the slow,
unsafe AIO path.  Shrink these reads to 112KB so they can use the safe, fast
AIO path instead.

MFC after: 1 week
X-MFC-With: 324568
Sponsored by: Spectra Logic Corp

6 years agoImplement IPMI support for RB_POWRECYCLE
Warner Losh [Wed, 25 Oct 2017 15:30:53 +0000 (15:30 +0000)]
Implement IPMI support for RB_POWRECYCLE

Some BMCs support power cycling the chassis via the chassis control
command 2 subcommand 2 (ipmitool called it 'chassis power cycle').  If
the BMC supports the chassis device, register a shutdown_final handler
that sends the power cycle command if request and waits up to 10s for
it to take effect. To minimize stack strain, we preallocate a ipmi
request in the softc. At the moment, we're verbose about what we're
doing.

Sponsored by: Netflix

6 years agoHandle RB_POWERCYCLE in ada driver
Warner Losh [Wed, 25 Oct 2017 15:30:48 +0000 (15:30 +0000)]
Handle RB_POWERCYCLE in ada driver

Allow the disks to be spun down when doing a POWERCYCLE as well as
POWEROFF.

Sponsored by: Netflix

6 years agoHandle RB_POWERCYCLE in the MI part of the kernel
Warner Losh [Wed, 25 Oct 2017 15:30:44 +0000 (15:30 +0000)]
Handle RB_POWERCYCLE in the MI part of the kernel

Signal init with SIGWINCH in shutdown_nice for RB_POWERCYCLE.

Sponsored by: Netflix

6 years agoImplement power cycle in init.
Warner Losh [Wed, 25 Oct 2017 15:30:40 +0000 (15:30 +0000)]
Implement power cycle in init.

If SIGWINCH is received, then halt with power cycle.

Sponsored by: Netflix

6 years agoAdd power cycle support to reboot/halt as -c.
Warner Losh [Wed, 25 Oct 2017 15:30:35 +0000 (15:30 +0000)]
Add power cycle support to reboot/halt as -c.

When -c is specified, the system will be power cycled if the
underlying hardware supports it. Otherwise the system will be halted
or rebooted depending on which command was used.

Sponsored by: Netflix

6 years agoAdd power cycle support (-c) to shutdown.
Warner Losh [Wed, 25 Oct 2017 15:30:30 +0000 (15:30 +0000)]
Add power cycle support (-c) to shutdown.

Sponsored by: Netflix

6 years agoRB_POWERCYCLE needs to be handled like RB_POWEROFF for decoding.
Warner Losh [Wed, 25 Oct 2017 15:30:25 +0000 (15:30 +0000)]
RB_POWERCYCLE needs to be handled like RB_POWEROFF for decoding.

Sponsored by: Netflix

6 years agoDefine RB_POWERCYCLE
Warner Losh [Wed, 25 Oct 2017 15:30:20 +0000 (15:30 +0000)]
Define RB_POWERCYCLE

RB_POWERCYCLE instructs the platform to power off and then power back
on a short time later, if that's possible. Otherwise, degrade to the
RB_POWEROFF behavior.

Sponsored by: Netflix

6 years agoRemove sys/boot/arm/at91 and ixp425
Warner Losh [Wed, 25 Oct 2017 15:28:05 +0000 (15:28 +0000)]
Remove sys/boot/arm/at91 and ixp425

Remove at91 bootloader. It only worked on AT91RM9200, and only
specific boards that were all EOLd 10 years ago.

Remove ixp425. It doesn't build anymore and is for boards that were
EOLd 8 years ago.

Sponsored by: Netflix

6 years agoMove BINDIR definition to defs.mk, and override where it isn't /boot
Warner Losh [Wed, 25 Oct 2017 15:27:58 +0000 (15:27 +0000)]
Move BINDIR definition to defs.mk, and override where it isn't /boot
(those files already do that so weren't changed).

Sponsored by: Netflix

6 years agoUse BOOTDIR consistently. We need to include bsd.init.mk early to make
Warner Losh [Wed, 25 Oct 2017 15:27:53 +0000 (15:27 +0000)]
Use BOOTDIR consistently. We need to include bsd.init.mk early to make
this happen. This will cause src.opts.mk to be included, so remove
that. This needs to propigate through the sys/boot tree.

Sponsored by: Netflix

6 years agoDo a chdir to SRCTOP/sys/boot before starting the run. This lets one
Warner Losh [Wed, 25 Oct 2017 15:27:48 +0000 (15:27 +0000)]
Do a chdir to SRCTOP/sys/boot before starting the run. This lets one
run this script from anywhere, but makes it only work on sys/boot.

Sponsored by: Netflix

6 years agoReport only the valid slots in the firmware log page.
Warner Losh [Wed, 25 Oct 2017 15:26:03 +0000 (15:26 +0000)]
Report only the valid slots in the firmware log page.

Printing the entire log page is causing confusion over available
slots. Report only those slots that are valid. In the case where the
firmware download isn't supported, assume that only the first slot is
valid (I have no hardware to test this assumption though)

Sponsored by: Netflix

6 years agoAdd nvme_controller_data argument to all print functions.
Warner Losh [Wed, 25 Oct 2017 15:25:55 +0000 (15:25 +0000)]
Add nvme_controller_data argument to all print functions.

It's desirable to access controler data to inform printing log pages
(such as limiting the printing to valid ranges).

Sponsored by: Netflix

6 years agoLimit top display of total swap size by the max swap size system can
Konstantin Belousov [Wed, 25 Oct 2017 11:44:46 +0000 (11:44 +0000)]
Limit top display of total swap size by the max swap size system can
handle.

Keep both pagesize and the new swap_maxpages in the static variables
to save sysctl calls.

Submitted by: ota@j.email.ne.jp
PR: 223149
MFC after: 2 weeks

6 years agoFix a bug reported by Felix Weinrank using the libfuzzer on the
Michael Tuexen [Wed, 25 Oct 2017 09:12:22 +0000 (09:12 +0000)]
Fix a bug reported by Felix Weinrank using the libfuzzer on the
userland stack.

MFC after: 3 days

6 years agoAdd support for compressed kernel dumps.
Mark Johnston [Wed, 25 Oct 2017 00:51:00 +0000 (00:51 +0000)]
Add support for compressed kernel dumps.

When using a kernel built with the GZIO config option, dumpon -z can be
used to configure gzip compression using the in-kernel copy of zlib.
This is useful on systems with large amounts of RAM, which require a
correspondingly large dump device. Recovery of compressed dumps is also
faster since fewer bytes need to be copied from the dump device.

Because we have no way of knowing the final size of a compressed dump
until it is written, the kernel will always attempt to dump when
compression is configured, regardless of the dump device size. If the
dump is aborted because we run out of space, an error is reported on
the console.

savecore(8) is modified to handle compressed dumps and save them to
vmcore.<index>.gz, as it does when given the -z option.

A new rc.conf variable, dumpon_flags, is added. Its value is added to
the boot-time dumpon(8) invocation that occurs when a dump device is
configured in rc.conf.

Reviewed by: cem (earlier version)
Discussed with: def, rgrimes
Relnotes: yes
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11723

6 years agobnxt: add support for Flow control setting using sysctl
Stephen Hurd [Tue, 24 Oct 2017 21:18:50 +0000 (21:18 +0000)]
bnxt: add support for Flow control setting using sysctl

Created sysctl node dev.bnxt.0.fc with following options.

A. dev.bnxt.0.fc.autoneg
B. dev.bnxt.0.fc.rx
C. dev.bnxt.0.fc.tx

Description:-
dev.bnxt.0.fc: flow ctrl
dev.bnxt.0.fc.autoneg: Enable or Disable Autoneg Flow Ctrl: 0 / 1
dev.bnxt.0.fc.rx: Enable or Disable Rx Flow Ctrl: 0 / 1
dev.bnxt.0.fc.tx: Enable or Disable Tx Flow Ctrl: 0 / 1

Submitted by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Reviewed by: shurd, sbruno
Approved by: sbruno (mentor)
Sponsored by: Broadcom Limited
Differential Revision: https://reviews.freebsd.org/D12599

6 years agoFix physical block number overflow in different places.
Fedor Uporov [Tue, 24 Oct 2017 20:10:08 +0000 (20:10 +0000)]
Fix physical block number overflow in different places.

Approved by:    pfg (mentor)
MFC after:      6 months

6 years agoSet doreallocblks sysctl value to zero by default because of
Fedor Uporov [Tue, 24 Oct 2017 19:16:25 +0000 (19:16 +0000)]
Set doreallocblks sysctl value to zero by default because of
possibility of filesystem corruption.

Approved by:    pfg (mentor)
MFC after:      2 weeks

6 years agoDo not free bufs in case of extents metadata blocks + remove unneeded asserts.
Fedor Uporov [Tue, 24 Oct 2017 19:14:33 +0000 (19:14 +0000)]
Do not free bufs in case of extents metadata blocks + remove unneeded asserts.

Approved by:    pfg (mentor)
MFC after:      6 months

6 years agoMicro-optimize the handling of fictitious pages in vm_page_free_prep().
Alan Cox [Tue, 24 Oct 2017 17:14:53 +0000 (17:14 +0000)]
Micro-optimize the handling of fictitious pages in vm_page_free_prep().
A fictitious page is always wired, so there is no point in trying to
remove one from the page queues.

Completely remove one inaccurate comment from vm_page_free_prep() and
correct another.

Reviewed by: kib, markj
MFC after: 1 week

6 years agoExtract a set of pmcstat functions and interfaces to the new internal
Ruslan Bukin [Tue, 24 Oct 2017 16:28:00 +0000 (16:28 +0000)]
Extract a set of pmcstat functions and interfaces to the new internal
library -- libpmcstat.

This includes PMC logging module, symbols lookup functions,
ELF parsing, process management, PMC attachment, etc.

This allows to reuse code while building new hwpmc(4)-based applications.

Also add pmcstat_symbol_search_by_name() function that allows to find
mapped IP range for a given function name.

Reviewed by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12718

6 years agoFix a bug in handling special ABORT chunks.
Michael Tuexen [Tue, 24 Oct 2017 16:24:12 +0000 (16:24 +0000)]
Fix a bug in handling special ABORT chunks.
Thanks to Felix Weinrank for finding this issue using libfuzzer with
the userland stack.

MFC after: 3 days

6 years agoiscsi_shutdown_post: do nothing if panic-ing
Andriy Gapon [Tue, 24 Oct 2017 14:59:31 +0000 (14:59 +0000)]
iscsi_shutdown_post: do nothing if panic-ing

There is nothing that that routine should or could really do in that
context.

Reported by: Ben RUBSON <ben.rubson@gmail.com>
MFC after: 1 week

6 years agoBump man page revision dates for r324941
Alan Somers [Tue, 24 Oct 2017 14:34:25 +0000 (14:34 +0000)]
Bump man page revision dates for r324941

Reported by: jhb
MFC after: 20 days
X-MFC-with: 324941
Sponsored by: Spectra Logic Corp

6 years agoFix a locking issue found by running AFL on the userland stack.
Michael Tuexen [Tue, 24 Oct 2017 14:28:56 +0000 (14:28 +0000)]
Fix a locking issue found by running AFL on the userland stack.
Thanks to Felix Weinrank for reporting the issue.

MFC after: 3 days

6 years agoRemove unneeded calls to access(2) from rtld(1); just call open(2) instead.
Edward Tomasz Napierala [Tue, 24 Oct 2017 12:56:08 +0000 (12:56 +0000)]
Remove unneeded calls to access(2) from rtld(1); just call open(2) instead.
The result looks like this:

--- przed       2017-10-21 23:19:21.445034000 +0100
+++ po  2017-10-21 23:18:50.031865000 +0100
@@ -11,7 +11,6 @@ mmap(0x0,102,PROT_READ,MAP_PRIVATE,3,0x0)      = 343665418
 close(3)                                        = 0 (0x0)
 open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165) ERR#2 'No such file or directory'
 munmap(0x80067d000,102)                                 = 0 (0x0)
-access("/usr/local/lib/libintl.so.8",F_OK)      = 0 (0x0)
 openat(AT_FDCWD,"/usr/local/lib/libintl.so.8",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
 fstat(3,{ mode=-rw-r--r-- ,inode=642560,size=55188,blksize=32768 }) = 0 (0x0)
 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366541824 (0x80067d000)
@@ -20,14 +19,13 @@ mmap(0x800877000,40960,PROT_READ|PROT_EXEC,MAP_PRIVATE
 mmap(0x800a81000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0xa000) = 34370752512 (0x800a81000)
 munmap(0x80067d000,4096)                        = 0 (0x0)
 close(3)                                        = 0 (0x0)
-access("/usr/local/lib/libc.so.7",F_OK)                 ERR#2 'No such file or directory'
+openat(AT_FDCWD,"/usr/local/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) ERR#2 'No such file or directory'
 openat(AT_FDCWD,"/var/run/ld-elf.so.hints",O_RDONLY|O_CLOEXEC,00) = 3 (0x3)
 read(3,"Ehnt\^A\0\0\0\M^@\0\0\0\M-2\0\0"...,128) = 128 (0x80)
 fstat(3,{ mode=-r--r--r-- ,inode=970684,size=306,blksize=32768 }) = 0 (0x0)
 lseek(3,0x80,SEEK_SET)                          = 128 (0x80)
 read(3,"/lib:/usr/lib:/usr/lib/compat:/u"...,178) = 178 (0xb2)
 close(3)                                        = 0 (0x0)
-access("/lib/libc.so.7",F_OK)                   = 0 (0x0)
 openat(AT_FDCWD,"/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
 fstat(3,{ mode=-r--r--r-- ,inode=1605239,size=1910320,blksize=32768 }) = 0 (0x0)
 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366541824 (0x80067d000)

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12766

6 years agoReplace lseek(2)/read(2) pair with pread(2), removing yet another syscall
Edward Tomasz Napierala [Tue, 24 Oct 2017 12:04:07 +0000 (12:04 +0000)]
Replace lseek(2)/read(2) pair with pread(2), removing yet another syscall
from the binary startup code.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoMake find_library() conform to style(9). No functional changes.
Edward Tomasz Napierala [Tue, 24 Oct 2017 11:24:54 +0000 (11:24 +0000)]
Make find_library() conform to style(9).  No functional changes.

Suggested by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoReword the conditional; it was ugly, and adding another parameter,
Edward Tomasz Napierala [Tue, 24 Oct 2017 11:16:38 +0000 (11:16 +0000)]
Reword the conditional; it was ugly, and adding another parameter,
which I'm going to do in a subsequent commit, would make it even uglier.
No functional changes.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoUse xmalloc and read(2) instead of mmap(2) to read in libmap.conf(5).
Edward Tomasz Napierala [Tue, 24 Oct 2017 10:48:26 +0000 (10:48 +0000)]
Use xmalloc and read(2) instead of mmap(2) to read in libmap.conf(5).
This removes the need to call munmap(2) afterwards.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12767

6 years agoAdd IPv6 support for O_TCPDATALEN opcode.
Andrey V. Elsukov [Tue, 24 Oct 2017 08:39:05 +0000 (08:39 +0000)]
Add IPv6 support for O_TCPDATALEN opcode.

PR: 222746
MFC after: 1 week

6 years agocxgbe(4): Read the MPS buffer group map from the firmware as it could be
Navdeep Parhar [Tue, 24 Oct 2017 05:41:48 +0000 (05:41 +0000)]
cxgbe(4): Read the MPS buffer group map from the firmware as it could be
different from hardware defaults.  The congestion channel map, which is
still fixed, needs to be tracked separately now.  Change the congestion
setting for TOE rx queues to match the drivers on other OSes while here.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoTreat a 'current' value of 0 as unlimited as a failsfe.
Warner Losh [Tue, 24 Oct 2017 02:25:42 +0000 (02:25 +0000)]
Treat a 'current' value of 0 as unlimited as a failsfe.

When limiting I/O, a value of 0 makes no sense as a limit. No progress
can be made. Trade the possibility that someone might be doing
something clever to achieve ultra-low I/O limits vs the damage of not
ever making progress on an I/O in favor of making progress. Now the
machine won't be useless if this accidentally gets requested.

Sponsored by: Netflix

6 years agoRemove artificial restriction on lio_listio's operation count
Alan Somers [Mon, 23 Oct 2017 23:12:01 +0000 (23:12 +0000)]
Remove artificial restriction on lio_listio's operation count

In r322258 I made p1003_1b.aio_listio_max a tunable. However, further
investigation shows that there was never any good reason for that limit to
exist in the first place. It's used in two completely different ways:

* To size a UMA zone, which globally limits the number of concurrent
  aio_suspend calls.

* To artifically limit the number of operations in a single lio_listio call.
  There doesn't seem to be any memory allocation associated with this limit.

This change does two things:

* Properly names aio_suspend's UMA zone, and sizes it based on a new constant.

* Eliminates the artifical restriction on lio_listio. Instead, lio_listio
  calls will now be limited by the more generous max_aio_queue_per_proc. The
  old p1003_1b.aio_listio_max is now an alias for
  vfs.aio.max_aio_queue_per_proc, so sysconf(3) will still work with
  _SC_AIO_LISTIO_MAX.

Reported by: bde
Reviewed by: jhb
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12120

6 years agoFix the error message when creating a zpool on a too-small device
Alan Somers [Mon, 23 Oct 2017 23:05:29 +0000 (23:05 +0000)]
Fix the error message when creating a zpool on a too-small device

Don't check for SPA_MINDEVSIZE in vdev_geom_attach when opening by path.
It's redundant with the check in vdev_open, and failing to attach here
results in the wrong error message being printed.  However, still check for
it in some other situations:

* When opening by guids, so we don't get bogged down reading from slow
  devices like floppy drives.
* In vdev_geom_read_pool_label for the same reason, because we iterate over
  all providers.
* If the caller requests that we verify the guid, because then we'll have to
  read from the device before vdev_open verifies the size.

PR: 222227
Reported by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Reviewed by: avg, mav
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12531

6 years agoAfter jemalloc was updated to version 5.0.0 in r319971, i386 executables
Dimitry Andric [Mon, 23 Oct 2017 21:31:04 +0000 (21:31 +0000)]
After jemalloc was updated to version 5.0.0 in r319971, i386 executables
linked with AddressSanitizer (even those linked on earlier versions of
FreeBSD, or with external versions of clang) started failing with errors
similar to:

  ==14688==AddressSanitizer CHECK failed:
  /usr/src/contrib/compiler-rt/lib/asan/asan_poisoning.cc:36
  "((AddrIsAlignedByGranularity(addr))) != (0)" (0x0, 0x0)

This is because AddressSanitizer expects all the TLS data in the program
to be aligned to at least 8 bytes.

Before the jemalloc 5.0.0 update, all the TLS data in the i386 version
of libc.so added up to 80 bytes (a multiple of 8), but 5.0.0 made this
grow to 2404 bytes (not a multiple of 8).  This is due to added caching
data in jemalloc's internal struct tsd_s.

To fix AddressSanitizer, ensure this struct is aligned to at least 16
bytes, which can be done unconditionally for all architectures.  (An
earlier version of the fix aligned the struct to 8 bytes, but only for
ILP32 architectures.  This was deemed unnecessarily complicated.)

PR: 221337
X-MFC-With: r319971

6 years agoSome cache related optimizations
Stephen Hurd [Mon, 23 Oct 2017 20:50:08 +0000 (20:50 +0000)]
Some cache related optimizations

1. prefetch 128 bytes of mbufs.
2. Re-order filling the pkt_info so cache stalls happen at the end
3. Define empty prefetch2cachelines() macro when the function isn't present.

Provides small performance improvments on some hardware

Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12447

6 years agouefi.8: mention use on (32-bit) arm
Ed Maste [Mon, 23 Oct 2017 20:32:18 +0000 (20:32 +0000)]
uefi.8: mention use on (32-bit) arm

Sponsored by: The FreeBSD Foundation

6 years agoClean up trailing whitespace
Enji Cooper [Mon, 23 Oct 2017 16:55:22 +0000 (16:55 +0000)]
Clean up trailing whitespace

MFC after: 1 week

6 years agoRemove dead stores
Enji Cooper [Mon, 23 Oct 2017 16:54:30 +0000 (16:54 +0000)]
Remove dead stores

The return value of various snprintf calls was stored in `len` and not used
in many functions.

MFC after: 1 week
Reported by: clang-scanbuild

6 years agoExpand explanation of atomicity.
Konstantin Belousov [Mon, 23 Oct 2017 16:14:55 +0000 (16:14 +0000)]
Expand explanation of atomicity.

Mention per-location total order, out of thin air, and torn writes
guarantees.  Mention C11 standard' memory model and one most important
FreeBSD additional requirement, that is aligned ordinary loads and
stores are atomic on processors.

The text is introductional and informal.  Reference the C11 and
C++1{1,4,7} standards for authorative description.

In collaboration with: alc
Sponsored by: The FreeBSD Foundation (kib)
MFC after: 1 week

6 years agoRemove resource_set_*() declarations from sys/bus.h.
Mark Johnston [Mon, 23 Oct 2017 16:02:48 +0000 (16:02 +0000)]
Remove resource_set_*() declarations from sys/bus.h.

The corresponding definitions were removed in r78135.

PR: 223189
Submitted by: marc.priggemeyer@gmail.com
MFC after: 1 week

6 years agoMove clear_unrhdr to tmpfs_free_tmp.
Matt Joras [Mon, 23 Oct 2017 15:43:38 +0000 (15:43 +0000)]
Move clear_unrhdr to tmpfs_free_tmp.

Clearing the unr in tmpfs_unmount is not correct. In the case of
multiple references to the tmpfs mount (e.g. when there are lookup
threads using it) it will not be the one to finish tmpfs_free_tmp. In
those cases tmpfs_free_node_locked will be the final one to execute
tmpfs_free_tmp, and until then the unr must be valid.

Reported by: pho
Approved/reviewed by: rstone (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12749

6 years agoFix the VM_NRESERVLEVEL == 0 build.
Mark Johnston [Mon, 23 Oct 2017 15:34:05 +0000 (15:34 +0000)]
Fix the VM_NRESERVLEVEL == 0 build.

Add VM_NRESERVLEVEL guards in the pmaps that implement transparent
superpage promotion using reservations.

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

6 years agoFix an omission in a comment
Enji Cooper [Mon, 23 Oct 2017 07:56:56 +0000 (07:56 +0000)]
Fix an omission in a comment

Soft float API support applies to armv7 too after r324340

6 years agoBump WITNESS_PENDLIST to accomodate sleepq chain bump.
Mateusz Guzik [Mon, 23 Oct 2017 01:00:35 +0000 (01:00 +0000)]
Bump WITNESS_PENDLIST to accomodate sleepq chain bump.

Reported by: ngie

6 years agoUse preferred defined paths, rather than relative paths in fdt.
Warner Losh [Sun, 22 Oct 2017 22:52:27 +0000 (22:52 +0000)]
Use preferred defined paths, rather than relative paths in fdt.

Sponsored by: Netflix

6 years agoCreate a shell script to build sys/boot on all the architectures.
Warner Losh [Sun, 22 Oct 2017 22:52:23 +0000 (22:52 +0000)]
Create a shell script to build sys/boot on all the architectures.

One could run this from any directory, but it's designed to do
regression testing on sys/boot (it only tests on a subset of
architectures since all of them would take a lot longer and not help).
This will also ensure that future commits to sys/boot compile
everywhere.

Sponsored by: Netflix

6 years agoUse SYSDIR instead of ${.CURDIR}/../..<etc>/sys.
Warner Losh [Sun, 22 Oct 2017 22:50:28 +0000 (22:50 +0000)]
Use SYSDIR instead of ${.CURDIR}/../..<etc>/sys.

Sponsored by: Netflix

6 years agoUse BOOTSRC here.
Warner Losh [Sun, 22 Oct 2017 22:50:23 +0000 (22:50 +0000)]
Use BOOTSRC here.

sponsored by: Netflix

6 years agoPrefer SRCTOP paths for bits we're grabbing from libc.
Warner Losh [Sun, 22 Oct 2017 22:50:19 +0000 (22:50 +0000)]
Prefer SRCTOP paths for bits we're grabbing from libc.

Sponsored by: Netflix

6 years agoMake at91 boot loader compile again.
Warner Losh [Sun, 22 Oct 2017 22:50:15 +0000 (22:50 +0000)]
Make at91 boot loader compile again.

No clue if it actually still works, but it might.

6 years agoEnd source directories with SRC rather than a hodgepodge of names
Warner Losh [Sun, 22 Oct 2017 22:50:08 +0000 (22:50 +0000)]
End source directories with SRC rather than a hodgepodge of names

BOOTDIR->BOOTSRC
FICLDIR->FICLSRC
LDR_MI->LDRSRC

This matches the patterns used in the rest of the system a bit vetter.

Suggested by: rgrimes@
Sponsored by: Netflix

6 years agoMove fdt and uboot defines into common uboot.mk.
Warner Losh [Sun, 22 Oct 2017 22:49:51 +0000 (22:49 +0000)]
Move fdt and uboot defines into common uboot.mk.

Sponsored by: Netflix

6 years agoMake the sleepq chain hash size configurable per-arch and bump on amd64.
Mateusz Guzik [Sun, 22 Oct 2017 20:43:50 +0000 (20:43 +0000)]
Make the sleepq chain hash size configurable per-arch and bump on amd64.

While here cache-align chains.

This shortens longest found chain during poudriere -j 80 from 32 to 16.

Pushing this higher up will probably require allocation on boot.

6 years agosdt: make all sdt probe sites test one variable
Mateusz Guzik [Sun, 22 Oct 2017 20:22:23 +0000 (20:22 +0000)]
sdt: make all sdt probe sites test one variable

This saves on cache misses at the expense of a slight grow of .text.

Note this is a bandaid for lack of hotpatching.

Discussed with: markj

6 years agoDelete declarations of struct pfs_bitmap, removed in r143841.
Mark Johnston [Sun, 22 Oct 2017 20:22:11 +0000 (20:22 +0000)]
Delete declarations of struct pfs_bitmap, removed in r143841.

MFC after: 1 week

6 years agosdt: whack unused SDT_PROBE_ENABLED
Mateusz Guzik [Sun, 22 Oct 2017 20:14:48 +0000 (20:14 +0000)]
sdt: whack unused SDT_PROBE_ENABLED

6 years agolibc: Do not refer to _DefaultRuneLocale in ctype inlines
Jilles Tjoelker [Sun, 22 Oct 2017 20:01:07 +0000 (20:01 +0000)]
libc: Do not refer to _DefaultRuneLocale in ctype inlines

Referring to _DefaultRuneLocale causes this >4KB structure to be copied to
all executables that use <ctype.h> inlines (except PIE executables).

This only affects the case where thread local storage is available.

_CurrentRuneLocale cannot be NULL, so the check can be removed entirely.

_DefaultRuneLocale needs to remain available for now since libc++ uses it.
The __isctype inline in include/_ctype.h also refers to _DefaultRuneLocale
and remains available because it may still be used by third party software.

Reviewed by: bdrewery, theraven
Differential Revision: https://reviews.freebsd.org/D10363

6 years agoAddress some miscellaneous issues in the CTF man page.
Mark Johnston [Sun, 22 Oct 2017 19:17:25 +0000 (19:17 +0000)]
Address some miscellaneous issues in the CTF man page.

- Fix a number of typos.
- Replace some illumos-specific references.
- Note that a type definition of kind CTF_K_FUNCTION may be followed by
  a null type identifier in order to provide 4-byte alignment for the
  next type definition.

MFC after: 2 weeks

6 years agoMFV r323105 (partial): 8300 fix man page issues found by mandoc 1.14.1
Mark Johnston [Sun, 22 Oct 2017 18:32:28 +0000 (18:32 +0000)]
MFV r323105 (partial): 8300 fix man page issues found by mandoc 1.14.1

illumos/illumos-gate@72d3dbb9ab4481606cb93caca98ba3b3a8eb6ce2
https://github.com/illumos/illumos-gate/commit/72d3dbb9ab4481606cb93caca98ba3b3a8eb6ce2

https://www.illumos.org/issues/8300
  Prior to integrating the mdocml update to 1.14.1, fix issues found by
  new version, especially the "new sentence, new line" style rule.

FreeBSD note: this revision merges only the changes to the CTF manual
page. The changes to the ZFS pages cannot be applied directly.

Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

Discussed with: avg
MFC after: 2 weeks

6 years agoChange kdb_active type to u_char.
Mateusz Guzik [Sun, 22 Oct 2017 13:42:56 +0000 (13:42 +0000)]
Change kdb_active type to u_char.

Fixes warnings from gcc and keeps the small size. Perhaps nesting should be moved
to another variablle.

Reported by: ngie

6 years agoClean up trailing whitespace in kdb_thr_ctx(..)
Enji Cooper [Sun, 22 Oct 2017 12:12:52 +0000 (12:12 +0000)]
Clean up trailing whitespace in kdb_thr_ctx(..)

MFC after: 1 week

6 years agoModernise this man page somewhat.
Bruce M Simpson [Sun, 22 Oct 2017 11:40:55 +0000 (11:40 +0000)]
Modernise this man page somewhat.

1. Add a reference to a good 3rd party list of compatible cables, but
provide suggestions for 'known good' vendors.

2. Change IP-based USB host-host example to a modern Ethernet one which
works 'out of box' with current Linux systems.

3. Explain that USB 3.0 is host-host, even though point-to-point soft
Ethernet can be achieved.

MFC after: 3 weeks

6 years agoAdd Prolific PL27A1 USB 3.0 Host-Host device to udbp(4).
Bruce M Simpson [Sun, 22 Oct 2017 11:15:58 +0000 (11:15 +0000)]
Add Prolific PL27A1 USB 3.0 Host-Host device to udbp(4).

Tested with a Plugable cable in VirtualBox against Linux 4.11.

MFC after: 2 weeks

6 years agoAdd OID for the vm.overcommit sysctl. This makes it possible to remove
Edward Tomasz Napierala [Sun, 22 Oct 2017 10:35:29 +0000 (10:35 +0000)]
Add OID for the vm.overcommit sysctl. This makes it possible to remove
one call to sysctl(2) from jemalloc startup code. (That also requires
changes to jemalloc, but I plan to push those to upstream first.)

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12745

6 years agoDon't call realpath(3) from libmap rtld code. This gets rid of a few calls
Edward Tomasz Napierala [Sun, 22 Oct 2017 10:32:40 +0000 (10:32 +0000)]
Don't call realpath(3) from libmap rtld code. This gets rid of a few calls
to fstatat(2) at binary startup; the difference looks like this:

--- przed       2017-10-14 13:55:49.983528000 +0100
+++ po  2017-10-14 14:10:39.134343000 +0100
@@ -1,15 +1,10 @@
 mmap(0x0,32768,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366173184 (0x800623000)
 issetugid()                                     = 0 (0x0)
-fstatat(AT_FDCWD,"/etc",{ mode=drwxr-xr-x ,inode=1364352,size=2560,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
-fstatat(AT_FDCWD,"/etc/libmap.conf",{ mode=-rw-r--r-- ,inode=1373288,size=102,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
 openat(AT_FDCWD,"/etc/libmap.conf",O_RDONLY|O_CLOEXEC,00) = 3 (0x3)
 fstat(3,{ mode=-rw-r--r-- ,inode=1373288,size=102,blksize=32768 }) = 0 (0x0)
 mmap(0x0,102,PROT_READ,MAP_PRIVATE,3,0x0)       = 34366205952 (0x80062b000)
 close(3)                                        = 0 (0x0)
-fstatat(AT_FDCWD,"/usr",{ mode=drwxr-xr-x ,inode=561792,size=512,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
-fstatat(AT_FDCWD,"/usr/local",{ mode=drwxr-xr-x ,inode=561800,size=512,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
-fstatat(AT_FDCWD,"/usr/local/etc",{ mode=drwxr-xr-x ,inode=653279,size=1536,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
-fstatat(AT_FDCWD,"/usr/local/etc/libmap.d",0x7fffffffcf50,AT_SYMLINK_NOFOLLOW) ERR#2 'No such file or directory'
+open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165) ERR#2 'No such file or directory'
 munmap(0x80062b000,102)                                 = 0 (0x0)
 openat(AT_FDCWD,"/var/run/ld-elf.so.hints",O_RDONLY|O_CLOEXEC,00) = 3 (0x3)
 read(3,"Ehnt\^A\0\0\0\M^@\0\0\0\M-2\0\0"...,128) = 128 (0x80)

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12741

6 years agoRemove the support for mknod(S_IFMT), which created dummy vnodes with
Konstantin Belousov [Sun, 22 Oct 2017 08:11:45 +0000 (08:11 +0000)]
Remove the support for mknod(S_IFMT), which created dummy vnodes with
VBAD type.

FFS ffs_write() VOP catches such vnodes and panics, other VOPs do not
check for the type and their behaviour is really undefined.  The
comment claims that this support was done for 'badsect' to flag bad
sectors, we do not have such facility in kernel anyway.

Reported by: Dmitry Vyukov <dvyukov@google.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoRegenerate src.conf(5) after r324340 (armv7 addition)
Enji Cooper [Sun, 22 Oct 2017 07:36:28 +0000 (07:36 +0000)]
Regenerate src.conf(5) after r324340 (armv7 addition)

6 years agoDefine LIBSA32 to LIBSA on i386 to fix build.
Warner Losh [Sun, 22 Oct 2017 07:25:28 +0000 (07:25 +0000)]
Define LIBSA32 to LIBSA on i386 to fix build.

Sponsored by: Netflix

6 years agoAdd note to updating about shifting LOADER_*SUPPORT options.
Warner Losh [Sun, 22 Oct 2017 03:52:26 +0000 (03:52 +0000)]
Add note to updating about shifting LOADER_*SUPPORT options.

Sponsored by: Netflix

6 years agoUse BOOTOBJ and BOOTDIR to find geli includes and libraries.
Warner Losh [Sun, 22 Oct 2017 03:52:22 +0000 (03:52 +0000)]
Use BOOTOBJ and BOOTDIR to find geli includes and libraries.

Sponsored by: Netflix

6 years agoWhen building standalone, don't define errno. Let the definition from
Warner Losh [Sun, 22 Oct 2017 03:52:17 +0000 (03:52 +0000)]
When building standalone, don't define errno. Let the definition from
stand.h override. This is similar to what we do in the kernel.

Sponsored by: Netflix

6 years agoStopgap fix to the mistmatch between LOADER_GELI_SUPPORT and
Warner Losh [Sun, 22 Oct 2017 03:52:12 +0000 (03:52 +0000)]
Stopgap fix to the mistmatch between LOADER_GELI_SUPPORT and
LOADER_NO_GELI_SUPPORT. To disable geli support in the loader, define
LOADER_GELI_SUPPORT=no. Proper warnings for for old build options to
follow.

Sponsored by: Netflix

6 years agoIntroduce BOOTOBJ: The top level object directory for the boot tree
Warner Losh [Sun, 22 Oct 2017 03:52:08 +0000 (03:52 +0000)]
Introduce BOOTOBJ: The top level object directory for the boot tree
and use it in preference to spelling out the path.

Sponsored by: Netflix

6 years agoUse BOOTDIR more consistently in defs.mk rather than repeat sys/boot.
Warner Losh [Sun, 22 Oct 2017 03:52:03 +0000 (03:52 +0000)]
Use BOOTDIR more consistently in defs.mk rather than repeat sys/boot.

Sponsored By: Netflix

6 years agomtx: implement thread lock fastpath
Mateusz Guzik [Sat, 21 Oct 2017 22:40:09 +0000 (22:40 +0000)]
mtx: implement thread lock fastpath

MFC after: 1 week

6 years agoRemove a atrun check that is nullified by r318443.
Brad Davis [Sat, 21 Oct 2017 21:58:24 +0000 (21:58 +0000)]
Remove a atrun check that is nullified by r318443.

Approved by: will

6 years agoPull in r316035 from upstream llvm trunk (by Tim Northover):
Dimitry Andric [Sat, 21 Oct 2017 19:14:45 +0000 (19:14 +0000)]
Pull in r316035 from upstream llvm trunk (by Tim Northover):

  AArch64: account for possible frame index operand in compares.

  If the address of a local is used in a comparison, AArch64 can fold
  the address-calculation into the comparison via "adds".
  Unfortunately, a couple of places (both hit in this one test) are not
  ready to deal with that yet and just assume the first source operand
  is a register.

This should fix an assertion failure while building the test suite of
www/firefox for AArch64.

PR: 223048
MFC after: 3 days

6 years agoAfter the import of libc++ 5.0.0, there is no need to disable building
Dimitry Andric [Sat, 21 Oct 2017 18:21:44 +0000 (18:21 +0000)]
After the import of libc++ 5.0.0, there is no need to disable building
libc++experimental.a on arm (r318654) and mips (r318859) anymore, since
upstream fixed the static assertions which would occur.

Noticed by: George Abdelmalik <gabdelmalik@uniridge.com.au>
PR: 223119
MFC after: 3 days

6 years agoCheck that the page which is freed as zeroed, indeed has all-zero content.
Konstantin Belousov [Sat, 21 Oct 2017 17:28:12 +0000 (17:28 +0000)]
Check that the page which is freed as zeroed, indeed has all-zero content.

This catches some rare mysterious failures at the source.  The check
is only performed on architectures which implement direct map, and
only enabled with option DIAGNOSTIC, similar to other costly
consistency checks.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

6 years agoMention sysrc(8) as scripting interface for the modification of config
Stefan Eßer [Sat, 21 Oct 2017 16:55:52 +0000 (16:55 +0000)]
Mention sysrc(8) as scripting interface for the modification of config
files. This is a follow up commit to r324721, which added sysrc(8) to
the SEE ALSO list.

Submitted by: Kurt Jaeger (lists at opsec.eu)
MFC after: 1 week

6 years agodtb/allwinner: Disconnect sinovoip-bpi-m3.dts from the build
Emmanuel Vadot [Sat, 21 Oct 2017 16:12:00 +0000 (16:12 +0000)]
dtb/allwinner: Disconnect sinovoip-bpi-m3.dts from the build

No active commiter have this board and we diverged too much from
the upstream DTS.

6 years agoFix spelling.
Michal Meloun [Sat, 21 Oct 2017 15:48:16 +0000 (15:48 +0000)]
Fix spelling.

Reported by: lidl
MFC after: 1 month

6 years agodts: Update our device tree sources file fomr Linux 4.13
Emmanuel Vadot [Sat, 21 Oct 2017 15:47:40 +0000 (15:47 +0000)]
dts: Update our device tree sources file fomr Linux 4.13

6 years agodts: Update the Device Tree Sources to Linux 4.13
Emmanuel Vadot [Sat, 21 Oct 2017 15:18:20 +0000 (15:18 +0000)]
dts: Update the Device Tree Sources to Linux 4.13

6 years agoFullify implementation of AT_HWCAP and AT_HWCAP2 for ARMv6,7.
Michal Meloun [Sat, 21 Oct 2017 12:16:21 +0000 (12:16 +0000)]
Fullify implementation of AT_HWCAP and AT_HWCAP2 for ARMv6,7.
This makes elf_aux_info(3) useable for ARM ports.

MFC after: 1 month

6 years agoAdd C++ decoration to auxv.v forgotten in r324815.
Michal Meloun [Sat, 21 Oct 2017 12:15:12 +0000 (12:15 +0000)]
Add C++ decoration to auxv.v forgotten in r324815.

MFC after: 1 month

6 years agoMake elf_aux_info() as public libc function.
Michal Meloun [Sat, 21 Oct 2017 12:06:18 +0000 (12:06 +0000)]
Make elf_aux_info() as public libc function.
- Teach elf aux vector functions about newly added AT_HWCAP and AT_HWCAP2
  vectors.
- Export _elf_aux_info() as new public libc function elf_aux_info(3)

The elf_aux_info(3) should be considered as FreeBSD counterpart of glibc
getauxval() with more robust interface.

Note:
We cannot name this new function as getauxval(), with glibc compatible
interface. Some ports autodetect its existence and then expects that all
Linux specific AT_<*> vectors are defined and implemented.

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

6 years agoAdd AT_HWCAP2 ELF auxiliary vector.
Michal Meloun [Sat, 21 Oct 2017 12:05:01 +0000 (12:05 +0000)]
Add AT_HWCAP2 ELF auxiliary vector.
 - allocate value for new AT_HWCAP2 auxiliary vector on all platforms.
 - expand 'struct sysentvec' by new 'u_long *sv_hwcap2', in exactly
   same way as for AT_HWCAP.

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

6 years agopms/freebsd: fix compiler warnings
Ryan Libby [Sat, 21 Oct 2017 07:23:45 +0000 (07:23 +0000)]
pms/freebsd: fix compiler warnings

 - A number of unused variable warnings,
 - a missing prototype warning (actually a dead function),
 - and a potential use of an uninitialized variable.

Reviewed by: pfg
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12683