]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agopf tests: Test CVE-2019-5598
kp [Fri, 22 Mar 2019 07:39:28 +0000 (07:39 +0000)]
pf tests: Test CVE-2019-5598

Verify that pf correctly drops inconsistent ICMP packets (i.e. where the
IP src/dst do not match the IP src/dst in the ICMP packet.

5 years agoAdd nvme support to the arm64 GENERIC kernel.
cperciva [Fri, 22 Mar 2019 06:36:40 +0000 (06:36 +0000)]
Add nvme support to the arm64 GENERIC kernel.

Submitted by: Greg V
Differential Revision: https://reviews.freebsd.org/D19657

5 years agoBuild if_ena.ko on arm64.
cperciva [Fri, 22 Mar 2019 06:33:26 +0000 (06:33 +0000)]
Build if_ena.ko on arm64.

This module provides support for the Amazon Elastic Network Adapter; it
was previously only built on x86 architectures, but Amazon EC2 now also
has ARM64 instances with this hardware.

Submitted by: Greg V

5 years agoInitialize uart_bus_space_mem.
cperciva [Fri, 22 Mar 2019 06:28:37 +0000 (06:28 +0000)]
Initialize uart_bus_space_mem.

This value was being used uninitialized, resulting in predictable issues
on systems with memory-mapped UART registers.

A case could be made that memmap_bus should be declared in a header
rather than being declared in each .c file which needs to refer to it,
but that's a broader style question.

This commit unbreaks hw.uart.console="mm:..." on ARM64.

Submitted by: Greg V

5 years agoObey SPCR AccessWidth parameter.
cperciva [Fri, 22 Mar 2019 06:21:03 +0000 (06:21 +0000)]
Obey SPCR AccessWidth parameter.

The "access width" value was hard-coded as 2, indicating 32-bit accesses;
instead, use the value specified in the SPCR table.

This unbreaks the console on EC2 "A1" family instances.

Submitted by: Greg V

5 years agoFrom r345400, remove the ippool rc script when ipfilter is not wanted
cy [Fri, 22 Mar 2019 01:43:55 +0000 (01:43 +0000)]
From r345400, remove the ippool rc script when ipfilter is not wanted
by the user.

PR: 218433
MFC after: 2 weeks
X-MFC with: r345400

5 years agopowerpc64: Handle the modern (2.05+) implementaiton of tlbie
jhibbits [Fri, 22 Mar 2019 01:43:31 +0000 (01:43 +0000)]
powerpc64: Handle the modern (2.05+) implementaiton of tlbie

By happenstance gcc4 puts 'vpn' into r0 in all uses of TLBIE(), but modern
gcc does not.  Also, the single-argument form of tlbie zeros all unused
arguments, making the modern tlbie instruction use r0 as the RS field
(LPID).

The vpn argument has the bottom 12 bits cleared (the input having been
left-shifted by 12 bits), which just so happens, on the POWER9 and previous
incarnations, to be the number of LPID bits supported.  With those bits
being zero, the instruction:

tlbie r0, r0

will invalidate the VPN in r0, in LPAR 0 (ignoring the upper bits of r0 for
the RS field).  One build with gcc8 yields:

tlbie r9, r0

with r0 having arbitrary contents, not equal to r9.  This leads to strange
crashes, behaviors, and panics, due to the requested TLB entry not actually
being invalidated.

As the moea64_native must work on both old and new, we explicitly zero out
r0 so that it can work with only the single argument, built with base gcc
and modern gcc.  isa3_hashtb takes a different approach, encoding the
two-argument form, soas not to explicitly clobber r0, and instead let the
compiler decide.

Reported by: Brandon Bergren
Tested by: Brandon Bergren
MFC after: 1 week

5 years agoFrom r345400, connect ippool to the build/install.
cy [Fri, 22 Mar 2019 01:42:27 +0000 (01:42 +0000)]
From r345400, connect ippool to the build/install.

PR: 218433
MFC after: 2 weeks
X-MFC with: r345400

5 years agoAdd rc.d support for ippool(8).
cy [Fri, 22 Mar 2019 01:30:51 +0000 (01:30 +0000)]
Add rc.d support for ippool(8).

I've been using ippool at my site for approximately two years. It's
about time this was committed.

PR: 218433
MFC after: 2 weeks

5 years agoCatch up with Clang 8.0.
jkim [Thu, 21 Mar 2019 21:45:02 +0000 (21:45 +0000)]
Catch up with Clang 8.0.

5 years agoCatch up with Clang 7.0.
jkim [Thu, 21 Mar 2019 21:43:23 +0000 (21:43 +0000)]
Catch up with Clang 7.0.

MFC after: 3 days

5 years agoFix smartpqi(4) malloc tag and description to match the driver name.
trasz [Thu, 21 Mar 2019 21:14:25 +0000 (21:14 +0000)]
Fix smartpqi(4) malloc tag and description to match the driver name.
No functional changes.

Reviewed by: sbruno
MFC after: 2 weeks
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D19625

5 years agoUse an explicit comparison with VM_GUEST_NO.
markj [Thu, 21 Mar 2019 20:07:50 +0000 (20:07 +0000)]
Use an explicit comparison with VM_GUEST_NO.

Reported by: jhb
MFC with: r345359
Sponsored by: The FreeBSD Foundation

5 years agoDisallow preemptive creation of wired superpage mappings.
markj [Thu, 21 Mar 2019 19:52:50 +0000 (19:52 +0000)]
Disallow preemptive creation of wired superpage mappings.

There are some unusual cases where a process may cause an mlock()ed
range of memory to be unmapped.  If the application subsequently
faults on that region, the handler may attempt to create a superpage
mapping backed by the resident, wired pages.  However, the pmap code
responsible for creating such a mapping (pmap_enter_pde() on i386
and amd64) does not ensure that a leaf page table page is available
if the superpage is later demoted; the demotion operation must therefore
perform a non-blocking page allocation and must unmap the entire
superpage if the allocation fails.  The pmap layer ensures that this
can never happen for wired mappings, and so the case described above
breaks that invariant.

For now, simply ensure that the MI fault handler never attempts to
create a wired superpage except via promotion.

Reviewed by: kib
Reported by: syzbot+292d3b0416c27c131505@syzkaller.appspotmail.com
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19670

5 years agoAlways create ipfw(4) hooks as long as module is loaded.
glebius [Thu, 21 Mar 2019 16:15:29 +0000 (16:15 +0000)]
Always create ipfw(4) hooks as long as module is loaded.

Now enabling ipfw(4) with sysctls controls only linkage of hooks to default
heads. When module is loaded fetch sysctls as tunables, to make it possible
to boot with ipfw(4) in kernel, but not linked to any pfil(9) hooks.

5 years agoarc4random: Adjust example code to use uniform() API
cem [Thu, 21 Mar 2019 14:45:08 +0000 (14:45 +0000)]
arc4random: Adjust example code to use uniform() API

PR: 236678
Reported by: Andras Farkas <deepbluemistake AT gmail.com>

5 years agoBump the IMAGE_SIZE for arm64 SoC images to prevent failures due
gjb [Thu, 21 Mar 2019 14:17:55 +0000 (14:17 +0000)]
Bump the IMAGE_SIZE for arm64 SoC images to prevent failures due
to full filesystem.  This makes the size of the arm64 SoC images
consistent with armv6 and armv7.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agonullfs: fix unmounts when filesystem is active.
kib [Thu, 21 Mar 2019 13:30:48 +0000 (13:30 +0000)]
nullfs: fix unmounts when filesystem is active.

If vflush() did not completely flushed the mount vnodes queue, either
retry for forced unmounts, or give up for non-forced.  This situation
can occur when new vnodes are instantiated while vflush() worked.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoAdd bus_release_resource() method to nexus on arm64
mw [Thu, 21 Mar 2019 10:51:36 +0000 (10:51 +0000)]
Add bus_release_resource() method to nexus on arm64

The nexus module was missing method for releasing bus resources. As a
result, it couldn't be released and the bus_release_resource() call would
return ENXIO.

Next call to bus_alloc_resource() for the same resource was returning
error, because it wasn't released previously and it was still busy.

The implementation of the nexus_release_resource() is the same as for
arm architecture.

Submitted by:  Michal Krawczyk <mk@semihalf.com>
Reported-by: Greg V <greg@unrelenting.technology>
Tested-by: cperciva, Greg V <greg@unrelenting.technology>
Obtained from: Semihalf
MFC after:     2 weeks
Sponsored by:  Amazon, Inc.
Differential revision: https://reviews.freebsd.org/D19641

5 years agoWhitespace cleanup in sdhci.c
bz [Thu, 21 Mar 2019 10:50:36 +0000 (10:50 +0000)]
Whitespace cleanup in sdhci.c

No functional changes.  Replace whitespace by tabs, indent with 4 spaces,
coalesce multi-line shorter than 80 characters,

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoPrevent double activation of admin interrupt in ENA
mw [Thu, 21 Mar 2019 10:46:10 +0000 (10:46 +0000)]
Prevent double activation of admin interrupt in ENA

The resource is already being activated in the bus_alloc_resource(),
because the flag RF_ACTIVE is being passed.

Double activation on arm64 is causing kernel panic.

Version of the driver was upgraded to 0.8.4.

Submitted by:  Michal Krawczyk <mk@semihalf.com>
Reported-by: Greg V <greg@unrelenting.technology>
Tested-by: cperciva, Greg V <greg@unrelenting.technology>
Obtained from: Semihalf
MFC after:     2 weeks
Sponsored by:  Amazon, Inc.
Differential revision: https://reviews.freebsd.org/D19655

5 years agoAlign struct sdhci_slot MMCCAM members.
bz [Thu, 21 Mar 2019 10:23:02 +0000 (10:23 +0000)]
Align struct sdhci_slot MMCCAM members.

Whitespace only, no functional change.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoRecognize the Amazon PCI serial device found in a1.* EC2 instances
cperciva [Thu, 21 Mar 2019 08:54:34 +0000 (08:54 +0000)]
Recognize the Amazon PCI serial device found in a1.* EC2 instances
as an NS8250 UART.

This is the same as the UART found in EC2 "bare metal" instances,
except that the card vendor shows up as 0x0000 rather than 0x1d0f.
This seems like a bug in the EC2 firmware; but we might as well support
it anyway.

Reported by: Greg V

5 years agoAttach the vmci(4) man page to the build. Looks like it's been
trasz [Thu, 21 Mar 2019 08:51:32 +0000 (08:51 +0000)]
Attach the vmci(4) man page to the build.  Looks like it's been
missed by mistake.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agopf tests: Move Sniffer to its own file
kp [Thu, 21 Mar 2019 08:15:46 +0000 (08:15 +0000)]
pf tests: Move Sniffer to its own file

Make it easier to re-use the sniffer class in other test support
scripts.

5 years agopf: Ensure that IP addresses match in ICMP error packets
kp [Thu, 21 Mar 2019 08:09:52 +0000 (08:09 +0000)]
pf: Ensure that IP addresses match in ICMP error packets

States in pf(4) let ICMP and ICMP6 packets pass if they have a
packet in their payload that matches an exiting connection.  It was
not checked whether the outer ICMP packet has the same destination
IP as the source IP of the inner protocol packet.  Enforce that
these addresses match, to prevent ICMP packets that do not make
sense.

Reported by: Nicolas Collignon, Corentin Bayet, Eloi Vanderbeken, Luca Moro at Synacktiv
Obtained from: OpenBSD
Security: CVE-2019-5598

5 years agoRemove -n flag, fix setting date / time
imp [Thu, 21 Mar 2019 06:47:23 +0000 (06:47 +0000)]
Remove -n flag, fix setting date / time

r342139 bork setting the date. This fixes it by simply removing the -n
flag.

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

5 years agoIn case of ENCODING_8BIT the EOF code will be pass to putchar.
oshogbo [Thu, 21 Mar 2019 06:31:14 +0000 (06:31 +0000)]
In case of ENCODING_8BIT the EOF code will be pass to putchar.
EOF check should be done before (uint8_t)c > 127 test.

Reported by: cem

5 years agoMake WD and WDC aliases for HGST.
imp [Thu, 21 Mar 2019 06:27:58 +0000 (06:27 +0000)]
Make WD and WDC aliases for HGST.

HGST was bought by WDC. Over the years, it has sold different drives
branded as HGST, WD or WDC. All of them need the HGST workaround of
sending 4k-sized packets (or multiples of 4k). And the ones that don't
really need this aren't broken by this change. Submitter is the vendor
who has tested these changes on a number of drives. I've simplified it
slightly, since we don't need additional vendors for this at this
time.

Submitted by: JacobBurley via github on behalf of WDC
Pull Request: https://github.com/freebsd/freebsd/pull/391

5 years agoFix powerpc and arm builds after r345361.
oshogbo [Thu, 21 Mar 2019 06:20:33 +0000 (06:20 +0000)]
Fix powerpc and arm builds after r345361.

Reported by: jenkins

5 years agostrings: do not continue if getc or getcharacter returns EOF
oshogbo [Thu, 21 Mar 2019 05:24:44 +0000 (05:24 +0000)]
strings: do not continue if getc or getcharacter returns EOF

Reported by: cem

5 years agostrings: do not depend on stdin
oshogbo [Thu, 21 Mar 2019 05:00:24 +0000 (05:00 +0000)]
strings: do not depend on stdin

Instead of depending on one stdin FILE structure and use freopen(3), pass to
the functions appropriate FILE structure.

Reviewed by: cem
Discussed with: emaste
Differential Revision: https://reviews.freebsd.org/D18037

5 years agoDon't attempt to measure TSC skew when running as a VM guest.
markj [Thu, 21 Mar 2019 02:52:22 +0000 (02:52 +0000)]
Don't attempt to measure TSC skew when running as a VM guest.

It simply doesn't work in general since VCPUs may migrate between
physical cores.  The approach used to measure skew also doesn't
make much sense in a VM.

PR: 218452
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agoEnsure that we use a 64-bit value for the last mmap() argument.
markj [Wed, 20 Mar 2019 23:35:15 +0000 (23:35 +0000)]
Ensure that we use a 64-bit value for the last mmap() argument.

When using __syscall(2), the offset argument is passed on the stack on
amd64.  Previously only 32 bits were written, so the upper 32 bits were
garbage and could cause the test to fail.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agogoogletest: backport GTEST_SKIP to googletest 1.8.1
asomers [Wed, 20 Mar 2019 23:15:58 +0000 (23:15 +0000)]
googletest: backport GTEST_SKIP to googletest 1.8.1

This commit backports revisions 00938b2b228f3b70d3d9e51f29a1505bdad43f1e and
59f90a338bce2376b540ee239cf4e269bf6d68ad from googletest's master branch to
our included version of googletest, which is based on 1.8.1. It adds the
GTEST_SKIP feature, which is very useful for a project like FreeBSD where
some tests depend on particular system configurations.

Reviewed by: ngie
Obtained from: github.com/google/googletest
MFC after: 2 months
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/rS345331

5 years agoThis is an additional and hopefully final fix for bug report 230962.
mckusick [Wed, 20 Mar 2019 23:11:05 +0000 (23:11 +0000)]
This is an additional and hopefully final fix for bug report 230962.
This bug was introduced with the change to use softdep_bp_to_mp()
in January 2018 changes -r327723 and -r327821. The softdep_bp_to_mp()
function failed to include VSOCK as one of the valid cases.

Although local-domain sockets do not allocate blocks in the filesystem,
they will allocate blocks if they use extended attributes (such as
ACLs). Thus, softdep_bp_to_mp() needs to return a non-NULL mount
pointer when presented with a socket vnode so that the soft updates
write complete will properly process the soft updates structures
associated with the extended attribute blocks. It was the failure
to process these soft updates structures, thus leaving them hanging
off the buffer, which lead to the "panic: softdep_deallocate_dependencies:
dangling deps" when trying to clean up the buffer after it was written.

PR:           230962
Reported by:  2t8mr7kx9f@protonmail.com
Reviewed by:  kib
Tested by:    Peter Holm
MFC after:    1 week
Sponsored by: Netflix

5 years agoBuild common kernel dependencies before modules.
bdrewery [Wed, 20 Mar 2019 22:49:41 +0000 (22:49 +0000)]
Build common kernel dependencies before modules.

This ensures files like genassym.o and awk/mfiles are generated before
descending into the modules build.  It may also allow some module builds
to not recreate files that are already present in the KERNBUILDDIR.

This fixes a rare build race where genassym.o is missing and assym.inc
is empty.

More work is planned around this to reduce some redundant dependency
generation in modules.

PR: 233339
MFC after: 2 weeks
Reported by: markj

5 years agoRename fuse(4) to fusefs(4)
asomers [Wed, 20 Mar 2019 21:48:43 +0000 (21:48 +0000)]
Rename fuse(4) to fusefs(4)

This makes it more consistent with other filesystems, which all end in "fs",
and more consistent with its mount helper, which is already named
"mount_fusefs".

Reviewed by: cem, rgrimes
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19649

5 years agoPull in r352826 from upstream lld trunk (by Fangrui Song):
dim [Wed, 20 Mar 2019 20:57:11 +0000 (20:57 +0000)]
Pull in r352826 from upstream lld trunk (by Fangrui Song):

  [ELF] Support --{,no-}allow-shlib-undefined

  Summary:
  In ld.bfd/gold, --no-allow-shlib-undefined is the default when
  linking an executable. This patch implements a check to error on
  undefined symbols in a shared object, if all of its DT_NEEDED entries
  are seen.

  Our approach resembles the one used in gold, achieves a good balance
  to be useful but not too smart (ld.bfd traces all DSOs and emulates
  the behavior of a dynamic linker to catch more cases).

  The error is issued based on the symbol table, different from
  undefined reference errors issued for relocations. It is most
  effective when there are DSOs that were not linked with -z defs (e.g.
  when static sanitizers runtime is used).

  gold has a comment that some system libraries on GNU/Linux may have
  spurious undefined references and thus system libraries should be
  excluded (https://sourceware.org/bugzilla/show_bug.cgi?id=6811). The
  story may have changed now but we make --allow-shlib-undefined the
  default for now. Its interaction with -shared can be discussed in the
  future.

  Reviewers: ruiu, grimar, pcc, espindola

  Reviewed By: ruiu

  Subscribers: joerg, emaste, arichardson, llvm-commits

  Differential Revision: https://reviews.llvm.org/D57385

Pull in r352943 from upstream lld trunk (by Fangrui Song):

  [ELF] Default to --no-allow-shlib-undefined for executables

  Summary:
  This follows the ld.bfd/gold behavior.

  The error check is useful as it captures a common type of ld.so
  undefined symbol errors as link-time errors:

      // a.cc => a.so (not linked with -z defs)
      void f(); // f is undefined
      void g() { f(); }

      // b.cc => executable with a DT_NEEDED entry on a.so
      void g();
      int main() { g(); }

      // ld.so errors when g() is executed (lazy binding) or when the program is started (-z now)
      // symbol lookup error: ... undefined symbol: f

  Reviewers: ruiu, grimar, pcc, espindola

  Reviewed By: ruiu

  Subscribers: llvm-commits, emaste, arichardson

  Tags: #llvm

  Differential Revision: https://reviews.llvm.org/D57569

Together, these add support for --no-allow-shlib-undefined, and make it
the default for executables, so they will fail to link if any symbols
from needed shared libraries are undefined.

Reported by: jbeich
PR: 236062, 236141
MFC after: 1 month
X-MFC-With: r344779

5 years agoUse -fdebug-prefix-map to map auto-generated kernel build paths.
markj [Wed, 20 Mar 2019 20:42:44 +0000 (20:42 +0000)]
Use -fdebug-prefix-map to map auto-generated kernel build paths.

The kernel build uses symlinks to make MD #includes like <machine/pcpu.h>
work.  Debug info ends up referencing these symlinks in a relative path,
so debuggers generally don't know how to find the corresponding headers.
Address this by using -fdebug-prefix-map to map relative paths through
the symlinks to their absolute paths in the source tree.  This is
consistent with how regular source file paths are defined in the
kernel's debug info.

Also map the current directory to an absolute path to the object
directory.  This gives debuggers a chance to find auto-generated files
like vnode_if.c if the object directory is available.

Reviewed by: emaste, jhb (previous version)
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19633

5 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
dim [Wed, 20 Mar 2019 19:18:26 +0000 (19:18 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
8.0.0 final release r356365.  There were no functional changes since the
most recent merge, of 8.0.0 rc5.

Release notes for llvm, clang, lld and libc++ 8.0.0 are now available:

https://llvm.org/releases/8.0.0/docs/ReleaseNotes.html
https://llvm.org/releases/8.0.0/tools/clang/docs/ReleaseNotes.html
https://llvm.org/releases/8.0.0/tools/lld/docs/ReleaseNotes.html
https://llvm.org/releases/8.0.0/projects/libcxx/docs/ReleaseNotes.html

PR: 236062
MFC after: 1 month
X-MFC-With: r344779

5 years agocxgbe(4): Treat the viid as an opaque identifier.
np [Wed, 20 Mar 2019 17:27:11 +0000 (17:27 +0000)]
cxgbe(4): Treat the viid as an opaque identifier.

Recent firmwares prefer to use a different format for viid internally
and this change allows them to do so.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoAdd some Cannon Lake chipset IDs.
mav [Wed, 20 Mar 2019 17:27:00 +0000 (17:27 +0000)]
Add some Cannon Lake chipset IDs.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

5 years agoTune chipset naming.
mav [Wed, 20 Mar 2019 17:21:17 +0000 (17:21 +0000)]
Tune chipset naming.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

5 years agogoogletest: backport GTEST_SKIP to googletest 1.8.1
asomers [Wed, 20 Mar 2019 17:11:25 +0000 (17:11 +0000)]
googletest: backport GTEST_SKIP to googletest 1.8.1

This commit backports revisions 00938b2b228f3b70d3d9e51f29a1505bdad43f1e and
59f90a338bce2376b540ee239cf4e269bf6d68ad from googletest's master branch to
our included version of googletest, which is based on 1.8.1.  It adds the
GTEST_SKIP feature, which is very useful for a project like FreeBSD where
some tests depend on particular system configurations.

Obtained from: github.com/google/googletest
Sponsored by: The FreeBSD Foundation

5 years agoloader: fix loading of kernels with . in path
emaste [Wed, 20 Mar 2019 16:24:47 +0000 (16:24 +0000)]
loader: fix loading of kernels with . in path

The loader indended to search the kernel file name (only) for . but
instead searched the entire path, so paths like
"boot/test.elfv2/kernel" would not work.

Submitted by: alfredo.junior_eldorado.org.br
Reviewed by: kevans
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19658

5 years agofuse(4): fix a race condition in the tests
asomers [Wed, 20 Mar 2019 16:08:07 +0000 (16:08 +0000)]
fuse(4): fix a race condition in the tests

Sometimes the fuse daemon doesn't die as soon as its /dev/fuse file
descriptor is closed; it needs to be unmounted first.

Sponsored by: The FreeBSD Foundation

5 years agovm_fault_copy_entry: accept invalid source pages.
kib [Wed, 20 Mar 2019 13:07:57 +0000 (13:07 +0000)]
vm_fault_copy_entry: accept invalid source pages.

Either msync(MS_INVALIDATE) or the object unlock during vnode
truncation can expose invalid pages backing wired entries.  Accept
them, but do not install them into destrination pmap.  We must create
copied pages in the copy case, because e.g. vm_object_unwire() expects
that the entry is fully backed.

Reported by: syzkaller, via emaste
Reported by: syzbot+514d40ce757a3f8b15bc@syzkaller.appspotmail.com
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D19615

5 years agonetmap: update unit tests
vmaffione [Wed, 20 Mar 2019 10:36:58 +0000 (10:36 +0000)]
netmap: update unit tests

Revision r345269 introduced changes that triggered a regression on netmap
unit tests (tests/sys/netmap/ctrl-api-test.c).
This change updates the unit tests to remove the regression.

Reported by: lwhsu
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19639

5 years agoDo not enter epoch section recursively.
ae [Wed, 20 Mar 2019 10:11:21 +0000 (10:11 +0000)]
Do not enter epoch section recursively.

A pfil hook is already invoked in NET_EPOCH section.

5 years agoUse NET_EPOCH instead of allocating separate one.
ae [Wed, 20 Mar 2019 10:06:44 +0000 (10:06 +0000)]
Use NET_EPOCH instead of allocating separate one.

MFC after: 1 month

5 years agolockf(1): return EX_UNAVAILABLE if -n is used and the lock file does not
avos [Wed, 20 Mar 2019 07:40:38 +0000 (07:40 +0000)]
lockf(1): return EX_UNAVAILABLE if -n is used and the lock file does not
exist

Apply EX_UNAVAILABLE patch part from PR 170775 to match the documentation.

Checked with a command from PR 210770:
lockf -n /tmp/doesnotexist echo; echo $?

PR: 210770
MFC after: 1 week

5 years agoOnly install amazon-ssm-agent into amd64 AMIs.
cperciva [Wed, 20 Mar 2019 07:24:21 +0000 (07:24 +0000)]
Only install amazon-ssm-agent into amd64 AMIs.

This package does not exist on aarch64 at present.

5 years agoPass --arm64 to bsdec2-image-upload when building ARM64 AMIs.
cperciva [Wed, 20 Mar 2019 07:19:09 +0000 (07:19 +0000)]
Pass --arm64 to bsdec2-image-upload when building ARM64 AMIs.

Future commits will allow the resulting EC2 AMIs to actually boot and
be usable.

5 years agoiflib: mark isc_driver_version as constant
erj [Tue, 19 Mar 2019 23:44:26 +0000 (23:44 +0000)]
iflib: mark isc_driver_version as constant

From Jake:
The iflib core never modifies the isc_driver_version string. Allow
drivers to safely assign pointers to constant buffers by marking this
parameter const.

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: erj@, gallatin@, jhb@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19577

5 years agoFix two typos: an -> and; the the -> the
imp [Tue, 19 Mar 2019 21:46:21 +0000 (21:46 +0000)]
Fix two typos: an -> and; the the -> the

And justify the paragraph after the change (and set fill column to 80
instead of 70).

Noticed by: rpokala@, vangyzen@

5 years agoImprove english grammar for kernel built time
wosch [Tue, 19 Mar 2019 19:58:40 +0000 (19:58 +0000)]
Improve english grammar for kernel built time

PR: 224433
Approved by: jhb
Differential Revision: https://reviews.freebsd.org/D19636

5 years agoiw_cxgbe: Remove unused smac_idx from the ep structure.
np [Tue, 19 Mar 2019 19:11:44 +0000 (19:11 +0000)]
iw_cxgbe: Remove unused smac_idx from the ep structure.

Submitted by: Krishnamraju Eraparaju @ Chelsio

5 years agoixv(4): Add missing IFLIB_IS_VF flag in iflib shared ctx
erj [Tue, 19 Mar 2019 18:07:44 +0000 (18:07 +0000)]
ixv(4): Add missing IFLIB_IS_VF flag in iflib shared ctx

From Krzysztof:
The driver built as KLD cannot be unloaded, if this flag is not set.

Submitted by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: shurd@, erj@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19402

5 years agoiflib: expose the Rx mbuf buffer size to drivers
erj [Tue, 19 Mar 2019 17:59:56 +0000 (17:59 +0000)]
iflib: expose the Rx mbuf buffer size to drivers

From Jake:
iflib_fl_setup calculates a suitable buffer size for the Rx mbufs based
on the isc_max_frame_size value that drivers setup. This calculation is
repeated by drivers when programming their hardware with the size of
each Rx buffer.

This can lead to a mismatch where the iflib mbuf size is different from
the expected size of the buffer as programmed by the hardware. This can
lead to unexpected results.

If iflib ever wants to support mbuf sizes larger than one page, every
driver must be updated to account for the new possible buffer sizes.

Fix this by calculating the mbuf size prior to calling IFDI_INIT, and
adding the iflib_get_rx_mbuf_sz function which will expose this value to
drivers, so that they do not repeat the same calculation.

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: shurd@, erj@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19489

5 years agofuse(4): remove more debugging printfs
asomers [Tue, 19 Mar 2019 17:49:15 +0000 (17:49 +0000)]
fuse(4): remove more debugging printfs

I missed these in r344664.  They're basically useless because they can only
be controlled at compile-time.  Also, de-inline fuse_internal_cache_attrs.
It's big enough to be a regular function, and this way it gets a dtrace FBT
probe.

Sponsored by: The FreeBSD Foundation

5 years agoiflib: prevent possible infinite loop in iflib_encap
erj [Tue, 19 Mar 2019 17:49:03 +0000 (17:49 +0000)]
iflib: prevent possible infinite loop in iflib_encap

From Jake:
iflib_encap calls bus_dmamap_load_mbuf_sg. Upon it returning EFBIG, an
m_collapse and an m_defrag are attempted to shrink the mbuf cluster to
fit within the DMA segment limitations.

However, if we call m_defrag, and then bus_dmamap_load_mbuf_sg returns
EFBIG on the now defragmented mbuf, we will continuously re-call
bus_dmamap_load_mbuf_sg over and over.

This happens because m_head isn't NULL, and remap is >1, so we don't try
to m_collapse or m_defrag again. The only way we exit the loop is if
m_head is NULL. However, m_head can't be modified by the call to
bus_dmamap_load_mbuf_sg, because we don't pass it as a double pointer.

I believe this will be an incredibly rare occurrence, because it is
unlikely that bus_dmamap_load_mbuf_sg will actually fail on the second
defragment with an EFBIG error. However, it still seems like
a possibility that we should account for.

Fix the exit check to ensure that if remap is >1, we will also exit,
even if m_head is not NULL.

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: shurd@, gallatin@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19468

5 years agobectl(8): change jail command to execute jail(8)
kevans [Tue, 19 Mar 2019 17:38:54 +0000 (17:38 +0000)]
bectl(8): change jail command to execute jail(8)

The jail(8) command provides a variety of jail pseudo-parameters that are
useful to consumers of bectl, mount.devfs being the most-often-requested
paramater by bectl users.

command, exec.start, nopersist, and persist may not be specified via -o to
bectl. The command/exec.start remains passed as it always has at the end of
bectl, and persistence is dictated by -b/-U bectl jail arguments.

Submitted by: Wes Maag <jwmaag gmail com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19282

5 years agoPSCI: Don't take missing implementation of psci get_version() as fatal.
mmel [Tue, 19 Mar 2019 15:42:11 +0000 (15:42 +0000)]
PSCI: Don't take missing implementation of psci get_version() as fatal.
Minimalistic PSCI implementation in U-Boot doesn't implement get_version()
method for some SoC. In this case, use PSCI version declared by 'psci' node
in DT as fallback.

MFC after: 2 weeks

5 years agoAdd comment about why we bother to use endian macros here, and why we
imp [Tue, 19 Mar 2019 15:03:20 +0000 (15:03 +0000)]
Add comment about why we bother to use endian macros here, and why we
must use bitfields.

5 years agoImprove cpufreq_dt.
mmel [Tue, 19 Mar 2019 14:34:53 +0000 (14:34 +0000)]
Improve cpufreq_dt.
 - older DT can use 'cpu0-supply' property for power supply binding.
 - don't expect that actual CPU frequency is contained in CPU
   operational point table, but read current CPU voltage directly from
   reguator. Typically, u-boot can set starting CPU frequency to any
   value.

MFC after: 2 weeks

5 years agoUse named field's initializer when constructing <foo>_platform structure.
mmel [Tue, 19 Mar 2019 14:32:54 +0000 (14:32 +0000)]
Use named field's initializer when constructing <foo>_platform structure.
In current code, the delay argument in FDT_PLATFORM_DEF(2) improperly
initialize refs field from kobj_class structure instead of delay_count
field.
This causes not working DELAY() function (due to never initialized
delay_count) in earlier boot stages, until the first timer was attached.

MFC after: 2 weeks

5 years agoextres: Unify error codes for <foo>_get_by_ofw_property() methods.
mmel [Tue, 19 Mar 2019 14:30:54 +0000 (14:30 +0000)]
extres: Unify error codes for <foo>_get_by_ofw_property() methods.
Return:
 - ENOENT if requested property doesn't exist
 - ENODEV if producer device is not (yet) attached
 - ENXIO otherwise

MFC after: 2 weeks

5 years agoRemove extra spaces.
ae [Tue, 19 Mar 2019 11:16:42 +0000 (11:16 +0000)]
Remove extra spaces.

MFC after: 1 month

5 years agoReapply r345274 with build fixes for 32-bit architectures.
ae [Tue, 19 Mar 2019 10:57:03 +0000 (10:57 +0000)]
Reapply r345274 with build fixes for 32-bit architectures.

  Update NAT64LSN implementation:

  o most of data structures and relations were modified to be able support
    large number of translation states. Now each supported protocol can
    use full ports range. Ports groups now are belongs to IPv4 alias
    addresses, not hosts. Each ports group can keep several states chunks.
    This is controlled with new `states_chunks` config option. States
    chunks allow to have several translation states for single alias address
    and port, but for different destination addresses.
  o by default all hash tables now use jenkins hash.
  o ConcurrencyKit and epoch(9) is used to make NAT64LSN lockless on fast path.
  o one NAT64LSN instance now can be used to handle several IPv6 prefixes,
    special prefix "::" value should be used for this purpose when instance
    is created.
  o due to modified internal data structures relations, the socket opcode
    that does states listing was changed.

Obtained from: Yandex LLC
MFC after: 1 month
Sponsored by: Yandex LLC

5 years agoConvert allocation of bpf_if in bpfattach2 from M_NOWAIT to M_WAITOK
ae [Tue, 19 Mar 2019 10:29:32 +0000 (10:29 +0000)]
Convert allocation of bpf_if in bpfattach2 from M_NOWAIT to M_WAITOK
and remove possible panic condition.

It is already allowed to sleep in bpfattach[2], since BPF_LOCK was
converted to SX lock in r332388. Also move KASSERT() to the top of
function and make full initialization before bpf_if will be linked
to BPF's list of interfaces.

MFC after: 2 weeks

5 years agoTurn on MK_OPENMP for i386 by default, now that it can build.
dim [Tue, 19 Mar 2019 06:58:28 +0000 (06:58 +0000)]
Turn on MK_OPENMP for i386 by default, now that it can build.

Noticed by: jbeich
PR: 236062, 236582
MFC after: 1 month
X-MFC-With: r344779

5 years agofuse(4): build the tests with the new googletest in base
asomers [Tue, 19 Mar 2019 03:10:13 +0000 (03:10 +0000)]
fuse(4): build the tests with the new googletest in base

Sponsored by: The FreeBSD Foundation

5 years agoAdd missing boot.4th verification
mw [Tue, 19 Mar 2019 02:45:32 +0000 (02:45 +0000)]
Add missing boot.4th verification

During initialization of the forth interpreter
the loader looks for "/boot/boot.4th"
and executes any code found there.
That file was loaded bypassing verification.
Add a call to verify_file to change that.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: sjg
Obtained from: Semihalf
Sponsored by: Stormshield

5 years agoPrevent loading SGX with incorrect EPC data
mw [Tue, 19 Mar 2019 02:33:58 +0000 (02:33 +0000)]
Prevent loading SGX with incorrect EPC data

It may happen on some machines, that even if SGX is disabled
in firmware, the driver would still attach despite EPC base and
size equal zero. Such behaviour causes a kernel panic when the
module is unloaded. Add a simple check to make sure we
only attach when these values are correctly set.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: br
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D19595

5 years ago[ath_hal_ar9300] Add some comments around the AR9300 ANI code.
adrian [Tue, 19 Mar 2019 00:07:12 +0000 (00:07 +0000)]
[ath_hal_ar9300] Add some comments around the AR9300 ANI code.

I'm refamiliarising myself with the behaviour of the ANI code and I thought
I'd drop some comments to remind myself.

5 years agoEnable building libomp.so for 32-bit x86. This is done by selectively
dim [Mon, 18 Mar 2019 21:04:28 +0000 (21:04 +0000)]
Enable building libomp.so for 32-bit x86.  This is done by selectively
enabling the functions that save and restore MXCSR, since access to this
register requires SSE support.

Note that you may run into other issues with OpenMP on i386, since this
*not* yet supported upstream, and certainly not extensively tested.

PR: 236062, 236582
MFC after: 1 month
X-MFC-With: r344779

5 years agoRemove --as-needed from the linker flags for libomp.so, as these
dim [Mon, 18 Mar 2019 19:56:00 +0000 (19:56 +0000)]
Remove --as-needed from the linker flags for libomp.so, as these
actually prevent the transitive dependency on libm.

Reported by: jbeich
PR: 236062, 236581
MFC after: 1 month
X-MFC-With: r344779

5 years agomakefs: Fix "time" mtree attribute handling
emaste [Mon, 18 Mar 2019 19:26:36 +0000 (19:26 +0000)]
makefs: Fix "time" mtree attribute handling

When processing mtree(5) MANIFEST files, makefs(8) previously threw an
error if it encountered an entry whose "time" attribute contained a
non-zero subsecond component (e.g. time=1551620152.987220000).

Update the handling logic to properly assign the subsecond component if
built with nanosecond support, or silently discard it otherwise.

Also, re-enable the time attribute for the kyua tests.

PR: 194703
Submitted by: Mitchell Horne <mhorne063@gmail.com>
Differential Revision: https://reviews.freebsd.org/D19627

5 years agosys/stat.h: Improve timespec compatibility with other BSDs
emaste [Mon, 18 Mar 2019 19:23:19 +0000 (19:23 +0000)]
sys/stat.h: Improve timespec compatibility with other BSDs

OpenBSD and NetBSD provide macros to directly reference the underlying
struct timespec's tv_nsec member.  While FreeBSD has such macros for
tv_sec, the others are missing.  Add the following macros:

st->st_atimensec
st->st_mtimensec
st->st_ctimensec
st->st_birthtimensec

Adding these fields will provide programs which reference them better
portability to FreeBSD.  An example of such a program is makefs(8),
which has unused support for subseconds that it has inherited from
NetBSD.

Submitted by: Mitchell Horne <mhorne063@gmail.com>
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D19626

5 years agoMFHead@r345275
asomers [Mon, 18 Mar 2019 19:21:53 +0000 (19:21 +0000)]
MFHead@r345275

5 years agoAlso explicitly link libomp.so against -lm, as it transitively depends
dim [Mon, 18 Mar 2019 19:11:11 +0000 (19:11 +0000)]
Also explicitly link libomp.so against -lm, as it transitively depends
on scalbn and a few other math functions, via libcompiler-rt.  This
should allow OpenMP programs to link with BFD linkers too.

Reported by: jbeich
PR: 236062, 236581
MFC after: 1 month
X-MFC-With: r344779

5 years agofuse(4): add tests for some mount options.
asomers [Mon, 18 Mar 2019 18:05:19 +0000 (18:05 +0000)]
fuse(4): add tests for some mount options.

This commit adds tests for the default_permissions and push_symlinks_in
mount options.  It doesn't add tests for allow_other, because I'm not sure
how that will interact with Kyua (the test will need to drop privileges).
All of the other mount options are undocumented.

PR: 216391
Sponsored by: The FreeBSD Foundation

5 years agoFixup syslog() call that should have used logging function pointer
lidl [Mon, 18 Mar 2019 15:45:06 +0000 (15:45 +0000)]
Fixup syslog() call that should have used logging function pointer

PR: 236614
Submitted by: Helge Oldach <freebsd@oldach.net>

5 years agoRevert r345274. It appears that not all 32-bit architectures have
ae [Mon, 18 Mar 2019 14:00:19 +0000 (14:00 +0000)]
Revert r345274. It appears that not all 32-bit architectures have
necessary CK primitives.

5 years agoUpdate NAT64LSN implementation:
ae [Mon, 18 Mar 2019 12:59:08 +0000 (12:59 +0000)]
Update NAT64LSN implementation:

o most of data structures and relations were modified to be able support
  large number of translation states. Now each supported protocol can
  use full ports range. Ports groups now are belongs to IPv4 alias
  addresses, not hosts. Each ports group can keep several states chunks.
  This is controlled with new `states_chunks` config option. States
  chunks allow to have several translation states for single alias address
  and port, but for different destination addresses.
o by default all hash tables now use jenkins hash.
o ConcurrencyKit and epoch(9) is used to make NAT64LSN lockless on fast path.
o one NAT64LSN instance now can be used to handle several IPv6 prefixes,
  special prefix "::" value should be used for this purpose when instance
  is created.
o due to modified internal data structures relations, the socket opcode
  that does states listing was changed.

Obtained from: Yandex LLC
MFC after: 1 month
Sponsored by: Yandex LLC

5 years agoFix a typo introduced in r344133
gallatin [Mon, 18 Mar 2019 12:41:42 +0000 (12:41 +0000)]
Fix a typo introduced in r344133

The line was misedited to change tt to st instead of
changing ut to st.

The use of st as the denominator in mul64_by_fraction() will lead
to an integer divide fault in the intr proc (the process holding
ithreads) where st will be 0.  This divide by 0 happens after
the total runtime for all ithreads exceeds 76 hours.

Submitted by: bde

5 years agonetmap: add support for multiple host rings
vmaffione [Mon, 18 Mar 2019 12:22:23 +0000 (12:22 +0000)]
netmap: add support for multiple host rings

Some applications forward from/to host rings most or all the
traffic received or sent on a physical interface. In this
cases it is desirable to have more than a pair of RX/TX host
rings, and use multiple threads to speed up forwarding.
This change adds support for multiple host rings. On registering
a netmap port, the user can specify the number of desired receive
and transmit host rings in the nr_host_tx_rings and nr_host_rx_rings
fields of the nmreq_register structure.

MFC after: 2 weeks

5 years agoAdd NAT64 CLAT implementation as defined in RFC6877.
ae [Mon, 18 Mar 2019 11:44:53 +0000 (11:44 +0000)]
Add NAT64 CLAT implementation as defined in RFC6877.

CLAT is customer-side translator that algorithmically translates 1:1
private IPv4 addresses to global IPv6 addresses, and vice versa.
It is implemented as part of ipfw_nat64 kernel module. When module
is loaded or compiled into the kernel, it registers "nat64clat" external
action. External action named instance can be created using `create`
command and then used in ipfw rules. The create command accepts two
IPv6 prefixes `plat_prefix` and `clat_prefix`. If plat_prefix is ommitted,
IPv6 NAT64 Well-Known prefix 64:ff9b::/96 will be used.

  # ipfw nat64clat CLAT create clat_prefix SRC_PFX plat_prefix DST_PFX
  # ipfw add nat64clat CLAT ip4 from IPv4_PFX to any out
  # ipfw add nat64clat CLAT ip6 from DST_PFX to SRC_PFX in

Obtained from: Yandex LLC
Submitted by: Boris N. Lytochkin
MFC after: 1 month
Relnotes: yes
Sponsored by: Yandex LLC

5 years agoAdd SPDX-License-Identifier and update year in copyright.
ae [Mon, 18 Mar 2019 10:50:32 +0000 (10:50 +0000)]
Add SPDX-License-Identifier and update year in copyright.

MFC after: 1 month

5 years agoModify struct nat64_config.
ae [Mon, 18 Mar 2019 10:39:14 +0000 (10:39 +0000)]
Modify struct nat64_config.

Add second IPv6 prefix to generic config structure and rename another
fields to conform to RFC6877. Now it contains two prefixes and length:
PLAT is provider-side translator that translates N:1 global IPv6 addresses
to global IPv4 addresses. CLAT is customer-side translator (XLAT) that
algorithmically translates 1:1 IPv4 addresses to global IPv6 addresses.
Use PLAT prefix in stateless (nat64stl) and stateful (nat64lsn)
translators.

Modify nat64_extract_ip4() and nat64_embed_ip4() functions to accept
prefix length and use plat_plen to specify prefix length.

Retire net.inet.ip.fw.nat64_allow_private sysctl variable.
Add NAT64_ALLOW_PRIVATE flag and use "allow_private" config option to
configure this ability separately for each NAT64 instance.

Obtained from: Yandex LLC
MFC after: 1 month
Sponsored by: Yandex LLC

5 years agoRevert r345244 for now.
markj [Mon, 18 Mar 2019 05:03:55 +0000 (05:03 +0000)]
Revert r345244 for now.

The code which advances the block number is simplistic and is not
correct when the starting offset is non-zero.  Revert the change until
this is fixed.

5 years agonet80211: correct check for SMPS node flags updates
avos [Mon, 18 Mar 2019 02:40:22 +0000 (02:40 +0000)]
net80211: correct check for SMPS node flags updates

Update node flags when driver supports SMPS, not when it is disabled or
in dynamic mode ((iv_htcaps & HTCAP_SMPS) != 0).

Checked with RTL8188EE (1T1R), STA mode - 'smps' word should disappear
from 'ifconfig wlan0' output.

MFC after: 2 weeks

5 years agoChange date of Canberra Day, now on second Monday in March.
grog [Sun, 17 Mar 2019 22:26:50 +0000 (22:26 +0000)]
Change date of Canberra Day, now on second Monday in March.
  https://en.wikipedia.org/wiki/Canberra_Day

5 years agoi386: improve detection of the fast page fault assist.
kib [Sun, 17 Mar 2019 18:31:48 +0000 (18:31 +0000)]
i386: improve detection of the fast page fault assist.

In particular, check that we are assisting the page fault from kernel mode.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years agoFix the gcc build (-Wstrict-prototypes) after r345244.
markj [Sun, 17 Mar 2019 18:06:13 +0000 (18:06 +0000)]
Fix the gcc build (-Wstrict-prototypes) after r345244.

Reported by: jenkins
MFC with: r345244

5 years agoOptimize lseek(SEEK_DATA) on UFS.
markj [Sun, 17 Mar 2019 17:34:06 +0000 (17:34 +0000)]
Optimize lseek(SEEK_DATA) on UFS.

The old implementation, at the VFS layer, would map the entire range of
logical blocks between the starting offset and the first data block
following that offset.  With large sparse files this is very
inefficient.  The VFS currently doesn't provide an interface to improve
upon the current implementation in a generic way.

Add ufs_bmap_seekdata(), which uses the obvious algorithm of scanning
indirect blocks to look for data blocks.  Use it instead of
vn_bmap_seekhole() to implement SEEK_DATA.

Reviewed by: kib, mckusick
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19598

5 years agoExplicitly link libomp.so against -lpthread, as it depends on pthread
dim [Sun, 17 Mar 2019 11:27:27 +0000 (11:27 +0000)]
Explicitly link libomp.so against -lpthread, as it depends on pthread
functionality.  This should make example OpenMP programs work out of the
box.

Reported by: jbeich
PR: 236062, 236581
MFC after: 1 month
X-MFC-With: r344779

5 years agoFix legacy IP autoconfiguration.
bz [Sun, 17 Mar 2019 09:31:09 +0000 (09:31 +0000)]
Fix legacy IP autoconfiguration.

It seems my subconcious plan in r345088 to not only prefer IPv6 autoconf
but to also slowly deteriorate legacy IP auto-configuration was uncovered
way too early.

In case IPv6 is a thing yet ipv6_autoconfif was not true, we would not
bring up the interface yet tell the follow-up DHCPv4 configuration in
ifconfig_up() that we did.  So unless you were doing SYNCDHCP or IPv6
you would not get legacy-IP DHCPv4 configuration.

I see multiple problems here: (a) people not yet using IPv6 (obviously a
problem), and (b) the dhclient startup script not running dhclient in
that case despite configured to do so (needs to be investigated seperately).

Reported by: Pawel Biernacki (pawel.biernacki gmail.com)
Tested by: Pawel Biernacki
Differential Revision: https://reviews.freebsd.org/D19488
Pointyhat to: bz (not sure if it is for breaking or
for letting them notice it so easily)

5 years agofdt: Explicitly mark fdt_slicer as dependent on geom_flashmap
jhibbits [Sun, 17 Mar 2019 04:33:17 +0000 (04:33 +0000)]
fdt: Explicitly mark fdt_slicer as dependent on geom_flashmap

Without this dependency relationship, the linker doesn't find the
flash_register_slicer() function, so kldload fails to load fdt_slicer.ko.

Discussed with: ian@