]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agolocaledef(1): Fix for memory leaks reported by coverity.
Pedro F. Giffuni [Thu, 9 Mar 2017 15:21:03 +0000 (15:21 +0000)]
localedef(1): Fix for memory leaks reported by coverity.

Also some small cleanups to match better current illumos.

CID: 1338540133854113385571338566

Obtained from: illumos
Discussed with: Yuri Pankov (@Nexenta)
MFC after: 5 days

7 years agoFix typo in comment.
Konstantin Belousov [Thu, 9 Mar 2017 13:41:57 +0000 (13:41 +0000)]
Fix typo in comment.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoloader.efi: only reduce the size of the staging area on Hyper-V
Dexuan Cui [Thu, 9 Mar 2017 12:09:07 +0000 (12:09 +0000)]
loader.efi: only reduce the size of the staging area on Hyper-V

Doing this on physical hosts turns out to be problematic, e.g. see comment
24 and 28 in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746.

To fix the real underlying issue correctly & thoroughly, IMO we need
a relocatable kernel, but that would require a lot of complicated long
term work:  https://reviews.freebsd.org/D9686?id=25414#inline-56969

For now, let's only apply efi_verify_staging_size() to VMs running on
Hyper-V, and restore the old behavior on physical machines since that
has been working for people for a long period of time, though that's
potentially unsafe...

MFC after: 2 weeks
Sponsored by: Microsoft

7 years agoo Typo in the comment fixed.
Maxim Konovalov [Thu, 9 Mar 2017 09:54:23 +0000 (09:54 +0000)]
o Typo in the comment fixed.

PR: 217617
Submitted by: lutz

7 years agostyle(9): sort the #includes
Enji Cooper [Thu, 9 Mar 2017 09:25:11 +0000 (09:25 +0000)]
style(9): sort the #includes

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoDon't create any threads before SI_SUB_INIT_IF in the LinuxKPI. Else
Hans Petter Selasky [Thu, 9 Mar 2017 09:17:43 +0000 (09:17 +0000)]
Don't create any threads before SI_SUB_INIT_IF in the LinuxKPI. Else
kthread_add() will assert it is called too soon. This fixes a startup
issue when COMPAT_LINUXKPI is in enabled the kernel configuration
file.

Reported by: Michael Butler <imb@protected-networks.net>
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix unused variable when built without INVARIANT_SUPPORT.
Alexander Motin [Thu, 9 Mar 2017 07:55:58 +0000 (07:55 +0000)]
Fix unused variable when built without INVARIANT_SUPPORT.

MFC after: 2 weeks

7 years agoExpect :test_zero_input to fail on amd64
Enji Cooper [Thu, 9 Mar 2017 06:58:47 +0000 (06:58 +0000)]
Expect :test_zero_input to fail on amd64

The clang 4.x+ upgrade now causes this testcase to fail, but
only on amd64.

More investigation will be done to determine the cause.

MFC after: 1 week
Reported by: Jenkins
PR: 217528
Sponsored by: Dell EMC Isilon

7 years agoDon't expect :test_large_inputs to fail with i386 anymore
Enji Cooper [Thu, 9 Mar 2017 06:56:44 +0000 (06:56 +0000)]
Don't expect :test_large_inputs to fail with i386 anymore

Recent changes (maybe a side-effect of the ATF-ification in r314649)
invalidate the failure expectation.

PR: 205446
MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoCache NLS data for strerror(3).
Mariusz Zaborski [Thu, 9 Mar 2017 06:41:00 +0000 (06:41 +0000)]
Cache NLS data for strerror(3).

7 years agoTry to extract the RFC1048 data from PXE. If we get enough info we can skip
Mariusz Zaborski [Thu, 9 Mar 2017 06:01:24 +0000 (06:01 +0000)]
Try to extract the RFC1048 data from PXE. If we get enough info we can skip
the bootp(). It removes unnecessary DHCP request from pxeloader.

Submitted by: kczekirda
Sponsored by: Oktawave
Initiated by: Matthew Dillon
Reviewed by: smh, gnn, bapt, oshogbo
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D9847

7 years agoSlight rewording in nvme(4)
Alan Somers [Thu, 9 Mar 2017 05:30:05 +0000 (05:30 +0000)]
Slight rewording in nvme(4)

Reviewed by: jimharris, imp
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D9927

7 years agoConfigure leap-second smearing (always).
Cy Schubert [Thu, 9 Mar 2017 05:29:24 +0000 (05:29 +0000)]
Configure leap-second smearing (always).

Leap-second smearing is an experimental option that may be specified in
ntp.conf(5) and the -x option on the command line to spread the effect
of a leap-second over an interval as specified by the leapsmearinterval
config file statement. Recommended values are between 7200 (2 hours) and
86400 (24 hours).

It is advised that leap-second smearing not be used for public NTP
servers (https://www.meinbergglobal.com/download/burnicki/Leap\
%20Second%20Smearing%20With%20NTP.pdf). It is also advised that NTP
clients not use a mix of NTP servers using leap-second smearing with
NTP servers not using leap-second smearing as that could cause
undefined client behaviour.

Leap-second smearing was committed to ports net/ntp and net/ntp-devel
by r426825 on 2016-11-22.

Suggested by: des
MFC after: 4 weeks

7 years agoSome style(9) fixes. No functional changes.
Mariusz Zaborski [Thu, 9 Mar 2017 05:13:07 +0000 (05:13 +0000)]
Some style(9) fixes. No functional changes.

Submitted by: kczekirda
Sponsored by: Oktawave
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D9395

7 years agoRename some tests to end in _test.
Bryan Drewery [Thu, 9 Mar 2017 04:20:00 +0000 (04:20 +0000)]
Rename some tests to end in _test.

Requested by: ngie
MFC after: 2 weeks
X-MFC-With: r314886

7 years agoRemove unneeded -x from tests.
Bryan Drewery [Thu, 9 Mar 2017 04:19:52 +0000 (04:19 +0000)]
Remove unneeded -x from tests.

Reported by: ngie
MFC after: 2 weeks
X-MFC-With: r314886

7 years agoImport the awk(1) manpage from OpenBSD
Baptiste Daroussin [Thu, 9 Mar 2017 03:27:53 +0000 (03:27 +0000)]
Import the awk(1) manpage from OpenBSD

As discussed during AsiaBSDcon devsummit, import the manpage from OpenBSD which
is has been rewritten in mdoc(7) format making it readable by default with
mandoc, it also has been extended by OpenBSD to cover all awk(1) options

Obtained from: OpenBSD
MFH: 1 week

7 years agoValidate values read from the RTC before trying BCD decoding
Eric van Gyzen [Thu, 9 Mar 2017 02:19:30 +0000 (02:19 +0000)]
Validate values read from the RTC before trying BCD decoding

Submitted by: cem
Reported by: Michael Gmelin <freebsd@grem.de>
Tested by: Oleksandr Tymoshenko <gonzo@bluezbox.com>
Sponsored by: Dell EMC

7 years agoec2.conf and vmimage.subr can be used from the installation livecd after
Andrew Thompson [Thu, 9 Mar 2017 01:26:10 +0000 (01:26 +0000)]
ec2.conf and vmimage.subr can be used from the installation livecd after
install to prepare an AMI image. This can be used to create a ZFS AMI disk
image using a virtual machine.

Change ec2.conf to use the pkg tool from a chroot rather than trying to
bootstrap it and fail from the livecd readonly filesystem.

Reviewed by: gjb

7 years ago[spigen] Add spigen module
Oleksandr Tymoshenko [Thu, 9 Mar 2017 01:21:28 +0000 (01:21 +0000)]
[spigen] Add spigen module

spigen provides userland API to SPI bus. Make it available as a loadable
module so people using official ARM images can enabled it on devices like
BBB or RPi without re-building kernel

MFC after: 1 week

7 years ago[spigen] make spigen device ready to be compiled as a module
Oleksandr Tymoshenko [Thu, 9 Mar 2017 01:00:27 +0000 (01:00 +0000)]
[spigen] make spigen device ready to be compiled as a module

- Add flag to indicate that device is opened by userland
- Replace "always fail" detach method with proper detach implementation

MFC after: 1 week

7 years agoDo not turn LOCK_DEBUG for INVARIANT_SUPPORT. This allows to add
Gleb Smirnoff [Thu, 9 Mar 2017 00:58:21 +0000 (00:58 +0000)]
Do not turn LOCK_DEBUG for INVARIANT_SUPPORT.  This allows to add
INVARIANT_SUPPORT into a kernel without performance penalties.

Discussed with: jhb, mjg

7 years agoIn linker_load_file() print name of a file that failed to load.
Gleb Smirnoff [Thu, 9 Mar 2017 00:56:07 +0000 (00:56 +0000)]
In linker_load_file() print name of a file that failed to load.

Discussed with: kib

7 years agoMake inp_lock_assert() depend on INVARIANT_SUPPORT, not INVARIANTS.
Gleb Smirnoff [Thu, 9 Mar 2017 00:55:19 +0000 (00:55 +0000)]
Make inp_lock_assert() depend on INVARIANT_SUPPORT, not INVARIANTS.
This will make INVARIANT-enabled modules, that use this function to load
successfully on a kernel that has INVARIANT_SUPPORT only.

7 years agoReduce stack usage in link_elf_load_file(), allocating struct nameidata.
Gleb Smirnoff [Thu, 9 Mar 2017 00:45:15 +0000 (00:45 +0000)]
Reduce stack usage in link_elf_load_file(), allocating struct nameidata.
This function may be called recursively, when a module pulls its dependencies.
Under certain circumstances, e.g. quad chain of dependencies and presence
of dtrace we may run out of stack.

7 years agoefidp manipulates UEFI Device Paths in various ways. At the moment, it
Warner Losh [Thu, 9 Mar 2017 00:33:38 +0000 (00:33 +0000)]
efidp manipulates UEFI Device Paths in various ways. At the moment, it
formats and parses UEFI standard Device Paths. In the future it will
also translate between FreeBSD driver names and UEFI Device Paths.

Sponsored by: Netflix

7 years agoFinish implementing -d/--device/--device-path flag to print variable
Warner Losh [Thu, 9 Mar 2017 00:31:36 +0000 (00:31 +0000)]
Finish implementing -d/--device/--device-path flag to print variable
as if it were a device path.

Remove language about a=b syntax on the command line. This will not be
implemented due to its limited usefulness. UEFI variables are binary
blobs, on the whole, and a simple work around exists for
strings. Clarify that the new value of the variable is taken from
stdin. Update manual with history.

Sponsored by: Netflix

7 years agoBring in EDK2 routines for printing and parsing device paths.
Warner Losh [Thu, 9 Mar 2017 00:31:31 +0000 (00:31 +0000)]
Bring in EDK2 routines for printing and parsing device paths.

This commit implements the (mostly?) Linux compatible
efidp_format_device_path and efidp_parse_device_path APIs. These are
the only APIs exposed through this library. However, they are built on
code from Tianocore's EDK2 MdePkg. They are brought in as new files
here for reasons described in FreeBSD-update.

Symbol versioning will be introduced to control what's exported from
the EDK2 code.

Some structural changes may be necessary when we move to sharing with
sys/boot/efi.

Sponsored by: Netflix

7 years agoShare UCS2/UTF8 routines between boot loader and userland.
Warner Losh [Thu, 9 Mar 2017 00:24:01 +0000 (00:24 +0000)]
Share UCS2/UTF8 routines between boot loader and userland.

Move the UCS2 to UTF8 routines over into sys/boot/efi and have
libefivar grab them from there.

Sponsored by: Netflix

7 years agosbin/devfs: clarify usage
Enji Cooper [Wed, 8 Mar 2017 23:58:10 +0000 (23:58 +0000)]
sbin/devfs: clarify usage

- Note existence of -m option.
- Note that -s applies to rule keyword, only, by adding usage text
  specifically for the `rule` and `ruleset` keywords.

Don't go into any further detail in usage(..) -- it's best that one
reads the manpage to get a better idea of how things work as there are
a number of different option-specific keywords and arguments, as well
as some rule grammar.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoiwn: add promiscuous mode support.
Andriy Voskoboinyk [Wed, 8 Mar 2017 22:49:22 +0000 (22:49 +0000)]
iwn: add promiscuous mode support.

Tested with Intel 6205, STA / MONITOR modes.

7 years agoFix compilation warning for powerpc64 by not using const keyword in
Hans Petter Selasky [Wed, 8 Mar 2017 21:28:53 +0000 (21:28 +0000)]
Fix compilation warning for powerpc64 by not using const keyword in
return types:

Type qualifiers ignored on function return type [-Wreturn-type]

Reported by: andreast @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoUpdate the comment for the Wacom WACF00e to make it clear it's not an
Ian Lepore [Wed, 8 Mar 2017 20:58:56 +0000 (20:58 +0000)]
Update the comment for the Wacom WACF00e to make it clear it's not an
accidental duplicate of WACF004.

PR: 217306

7 years agoAdd the pnp id for a Wacom 'WACF00e' tablet.
Ian Lepore [Wed, 8 Mar 2017 20:41:27 +0000 (20:41 +0000)]
Add the pnp id for a Wacom 'WACF00e' tablet.

PR: 217306
Submitted by: large.hadron.collider@gmx.com

7 years agoHandle fifo size differences between older and newer revs of pl011 hardware.
Ian Lepore [Wed, 8 Mar 2017 18:53:32 +0000 (18:53 +0000)]
Handle fifo size differences between older and newer revs of pl011 hardware.

Starting with rev 5 (which is inexplicably indicated by a version number
of '3' in the Peripheral ID register), the pl011 doubled the size of the
rx and tx fifos, to 32 bytes, so read the ID register and set the size
variables in the softc accordingly.

An interesting wrinkle in this otherwise-simple concept is that the
bcm2835 SoC, used in Raspberry Pi systems among others, has the rev 5
pl011 hardware, but somehow also has the older 16-byte fifos.  We check
the FDT data to see if the hardware is part of a bcm283x system and use
the smaller size if so.

Thanks to jchandra@ for pointing out that newer hardware has bigger fifos.

7 years agoFix permissions on /tmp when installing the runtime package.
Glen Barber [Wed, 8 Mar 2017 18:52:40 +0000 (18:52 +0000)]
Fix permissions on /tmp when installing the runtime package.

Reported by: many
Patch by: Kyle Evans
PR: 217574
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoUse the buildworld includes and defaults when building pkt-gen. This will
Sean Bruno [Wed, 8 Mar 2017 17:29:40 +0000 (17:29 +0000)]
Use the buildworld includes and defaults when building pkt-gen.  This will
mean that you need a world built to reliably build pkg-gen but this keeps
the build from failing when your source doesn't match your host running
version, e.g. building 12 on 11.

Submitted by: Matt Macy <mmacy@nextbsd.org>
MFC after: 2 weeks
Sponsored by: Limelight Networks

7 years agoRelease all previously allocated resources.
Michal Meloun [Wed, 8 Mar 2017 14:52:03 +0000 (14:52 +0000)]
Release all previously allocated resources.

7 years agoMFV r314911: 7867 ARC space accounting leak
Andriy Gapon [Wed, 8 Mar 2017 13:52:45 +0000 (13:52 +0000)]
MFV r314911: 7867 ARC space accounting leak

illumos/illumos-gate@6de76ce2a90f54fecb0dba46dca08c99cef7aa08
https://github.com/illumos/illumos-gate/commit/6de76ce2a90f54fecb0dba46dca08c99cef7aa08

https://www.illumos.org/issues/7867
  It seems that in the case where arc_hdr_free_pdata() sees HDR_L2_WRITING() we
  would fail to update the ARC space statistics.
  In the normal case those statistics are updated in arc_free_data_buf(). But in
  the arc_hdr_free_on_write() path we don't do that.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Andriy Gapon <avg@FreeBSD.org>

MFC after: 10 days

7 years agoMFV r314910: 7843 get_clones_stat() is suboptimal for lots of clones
Andriy Gapon [Wed, 8 Mar 2017 13:48:26 +0000 (13:48 +0000)]
MFV r314910: 7843 get_clones_stat() is suboptimal for lots of clones

illumos/illumos-gate@c5bde7273ef861a8dc54cfb9abe48d56062177da
https://github.com/illumos/illumos-gate/commit/c5bde7273ef861a8dc54cfb9abe48d56062177da

https://www.illumos.org/issues/7843
  get_clones_stat() could be very slow if a snapshot has many (thousands) clones.
  Clone names are added to an nvlist that's created with NV_UNIQUE_NAME.
  So, each time a new name is appended to the list, the whole list is searched
  linearly to see if that name is not already in the list. That results in the
  quadratic complexity.
  That should be easy to fix as we know in advance that we should not get any
  duplicate names, so we can drop NV_UNIQUE_NAME when creating the list.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Andriy Gapon <avg@FreeBSD.org>

MFC after: 1 week
Sponsored by: ClusterHQ

7 years ago7867 ARC space accounting leak
Andriy Gapon [Wed, 8 Mar 2017 13:40:24 +0000 (13:40 +0000)]
7867 ARC space accounting leak

illumos/illumos-gate@6de76ce2a90f54fecb0dba46dca08c99cef7aa08
https://github.com/illumos/illumos-gate/commit/6de76ce2a90f54fecb0dba46dca08c99cef7aa08

https://www.illumos.org/issues/7867
  It seems that in the case where arc_hdr_free_pdata() sees HDR_L2_WRITING() we
  would fail to update the ARC space statistics.
  In the normal case those statistics are updated in arc_free_data_buf(). But in
  the arc_hdr_free_on_write() path we don't do that.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Andriy Gapon <avg@FreeBSD.org>

7 years ago7843 get_clones_stat() is suboptimal for lots of clones
Andriy Gapon [Wed, 8 Mar 2017 13:39:22 +0000 (13:39 +0000)]
7843 get_clones_stat() is suboptimal for lots of clones

illumos/illumos-gate@c5bde7273ef861a8dc54cfb9abe48d56062177da
https://github.com/illumos/illumos-gate/commit/c5bde7273ef861a8dc54cfb9abe48d56062177da

https://www.illumos.org/issues/7843
  get_clones_stat() could be very slow if a snapshot has many (thousands) clones.
  Clone names are added to an nvlist that's created with NV_UNIQUE_NAME.
  So, each time a new name is appended to the list, the whole list is searched
  linearly to see if that name is not already in the list. That results in the
  quadratic complexity.
  That should be easy to fix as we know in advance that we should not get any
  duplicate names, so we can drop NV_UNIQUE_NAME when creating the list.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Andriy Gapon <avg@FreeBSD.org>

7 years agoWhen chunking large DIOCGDELETE, do it on stripe edge.
Alexander Motin [Wed, 8 Mar 2017 12:18:58 +0000 (12:18 +0000)]
When chunking large DIOCGDELETE, do it on stripe edge.

MFC after: 2 weeks

7 years agoUnbreak ARMv6 world.
Michal Meloun [Wed, 8 Mar 2017 11:40:27 +0000 (11:40 +0000)]
Unbreak ARMv6 world.

The new compiler_rt library imported with clang 4.0.0 have several fatal
issues (non-functional __udivsi3 for example) with ARM specific instrict
functions. As temporary workaround, until upstream solve these problems,
disable all thumb[1][2] related feature.

7 years agoAdd initial support for UNMAP granularity.
Alexander Motin [Wed, 8 Mar 2017 11:24:33 +0000 (11:24 +0000)]
Add initial support for UNMAP granularity.

Report UNMAP granularity as stripesize/-offset if we have no other values
to report there.

Add new quirk DA_Q_STRICT_UNMAP for cases when target is too critical to
misaligned UNMAP request, reporting errors instead of being suboptimal.
Setting this quirk makes da periph to forcefully align all UNMAP requests
to avoid those errors by the cost of some odd ranges not being UNMAP'ed.
This makes UNMAP usable within VMware 6.x VMs, just now 100% efficient.

MFC after: 2 weeks

7 years agoCleanup the LinuxKPI slab implementation.
Hans Petter Selasky [Wed, 8 Mar 2017 11:09:27 +0000 (11:09 +0000)]
Cleanup the LinuxKPI slab implementation.

Put large functions into linux_slab.c instead of declaring them static
inline.

Add support for more memory allocation wrappers like kmalloc_array()
and __vmalloc().

Make sure either the M_WAITOK or the M_NOWAIT flag is set and mask
away unused memory allocation flags before calling FreeBSD's malloc()
routine.

Move kmalloc_node() definition to slab.h where it belongs.

Implement support for the SLAB_DESTROY_BY_RCU feature when creating a
kmem_cache which basically means kmem_cache memory is freed using
call_rcu().

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoImplement eth_zero_addr() in the LinuxKPI.
Hans Petter Selasky [Wed, 8 Mar 2017 09:53:20 +0000 (09:53 +0000)]
Implement eth_zero_addr() in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoRemove reference to GNU info hier(7)
Baptiste Daroussin [Wed, 8 Mar 2017 08:57:35 +0000 (08:57 +0000)]
Remove reference to GNU info hier(7)
we have removed texinfo in FreeBSD 11.0

7 years agotexinfo is gone in r276551 remove the related directories
Baptiste Daroussin [Wed, 8 Mar 2017 08:52:15 +0000 (08:52 +0000)]
texinfo is gone in r276551 remove the related directories

Reported by: jbeich

7 years agoUse LDFLAGS rather than CFLAGS when linking.
Brooks Davis [Wed, 8 Mar 2017 08:25:26 +0000 (08:25 +0000)]
Use LDFLAGS rather than CFLAGS when linking.

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

7 years agoRemove now unneded cast.
Andrey V. Elsukov [Wed, 8 Mar 2017 08:09:41 +0000 (08:09 +0000)]
Remove now unneded cast.

7 years agoMatch JETSON-TK1 FreeBSD specific DTS stub with r314854.
Michal Meloun [Wed, 8 Mar 2017 07:23:15 +0000 (07:23 +0000)]
Match JETSON-TK1 FreeBSD specific DTS stub with r314854.

7 years agoRemove extraneous arguments and options, which don't make sense for
Cy Schubert [Wed, 8 Mar 2017 07:02:39 +0000 (07:02 +0000)]
Remove extraneous arguments and options, which don't make sense for
a file documented in volume 5.

MFC after: 3 days

7 years agoOnly install 900.tcpwrap if MK_INETD != "no" and MK_TCP_WRAPPERS != "no"
Enji Cooper [Wed, 8 Mar 2017 06:12:16 +0000 (06:12 +0000)]
Only install 900.tcpwrap if MK_INETD != "no" and MK_TCP_WRAPPERS != "no"

It relies on output from inetd that is triggered by MK_TCP_WRAPPERS=yes.

We need to check for both knobs being set -- otherwise the script doesn't
have much value.

PR: 217577
Submitted by: Sergey <kpect@protonmail.com> (MK_TCP_WRAPPERS piece)
MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoFix a couple of typos and reword some sentences in bsd.README.
John Baldwin [Wed, 8 Mar 2017 05:49:58 +0000 (05:49 +0000)]
Fix a couple of typos and reword some sentences in bsd.README.

Reviewed by: bdrewery
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9922

7 years agousr.bin/fortune: convert to OBJTOP/SRCTOP idioms
Enji Cooper [Wed, 8 Mar 2017 05:31:54 +0000 (05:31 +0000)]
usr.bin/fortune: convert to OBJTOP/SRCTOP idioms

- Use OBJTOP/SRCTOP-relative paths when looking for include files and
  strfile.
- Add FORTUNES_OBJ and FORTUNES_SRC to abbreviate usr.bin/fortune
  pathing.

This is being done to simplify make output/idioms.

MFC after: 1 week
Reviewed by: bdrewery
Sponsored by: Dell EMC Isilon
Differential Revision: D9916

7 years agoFix install due to incorrect placement of pwait dir in r314886.
Cy Schubert [Wed, 8 Mar 2017 05:27:04 +0000 (05:27 +0000)]
Fix install due to incorrect placement of pwait dir in r314886.

Reported by: Shawn Webb <shawn.webb@hardenedbsd.org>
MFC after: 2 weeks
X-MFC with: r314886

7 years agoloader.efi: finally fix the off-by-one bug in efi_verify_staging_size()
Dexuan Cui [Wed, 8 Mar 2017 02:50:29 +0000 (02:50 +0000)]
loader.efi: finally fix the off-by-one bug in efi_verify_staging_size()

r314828(loader.efi: fix an off-by-one bug in efi_verify_staging_size())
doesn't really fix the bug and this patch adds the missing part.

It's a shame that I didn't make everything correct at the very beginning...

MFC after: 2 weeks
Sponsored by: Microsoft

7 years agoCopy needed include files from EDK2. This is a minimal set gleened
Warner Losh [Wed, 8 Mar 2017 02:47:59 +0000 (02:47 +0000)]
Copy needed include files from EDK2. This is a minimal set gleened
from the .depend files after the build:
cp -r ../vendor/edk2/MdePkg/Include sys/contrib/edk2
cd lib/libefivar
make
pushd `make -V .OBJDIR`
cat .depend*.o | grep sys/contrib | cut -d' ' -f 3 |
sort -u | sed -e 's=/full/path/sys/contrib/edk2/==' > /tmp/xxx
popd
cd ../../sys/contrib/edk2
rm -rf Include
for i in `cat /tmp/xxx`; do
svn cp svn+ssh://repo.freebsd.org/base/vendor/edk2/dist/MdePkg/$i $i
done
svn cp svn+ssh://repo.freebsd.org/base/vendor/edk2/dist/MdePkg/MdePkg.dec .

The original EDK2 repo is ~265MB, the MdePkg is ~23MB, all
MdePkg/Includes is ~7MB and this minimal set is ~1.3MB.

Sponsored by: Netflix

7 years agoAvoid dereferencing unintialized elements in the error path.
Warner Losh [Tue, 7 Mar 2017 23:06:41 +0000 (23:06 +0000)]
Avoid dereferencing unintialized elements in the error path.

Some drives sometimes have errors for things like setting the number
of queue entries in the submission queue. The error paths taken for
these drives ensure a panic dereferencing uninialized data.

Sponsored by: Netflix

7 years agocwd10 takes the low 32-bits and cwd11 takes the upper 32-bits of the
Warner Losh [Tue, 7 Mar 2017 23:02:59 +0000 (23:02 +0000)]
cwd10 takes the low 32-bits and cwd11 takes the upper 32-bits of the
lba. Rather than do a cast to uint64_t, which clang warns might be
unaligned, do the stores 32-bits at a time.

Sponsored by: Netflix

7 years agoAdd and use a MMC_DECLARE_BRIDGE macro for declaring mmc(4) bridges
Marius Strobl [Tue, 7 Mar 2017 22:42:44 +0000 (22:42 +0000)]
Add and use a MMC_DECLARE_BRIDGE macro for declaring mmc(4) bridges
as kernel drivers and their dependency onto mmc(4); this allows for
incrementing the mmc(4) module version but also for entire omission
of these bridge declarations for mmccam(4) in a single place, i. e.
in dev/mmc/bridge.h.

7 years agopwait: Add a -t flag to specify a timeout before exiting, and tests.
Bryan Drewery [Tue, 7 Mar 2017 22:16:55 +0000 (22:16 +0000)]
pwait: Add a -t flag to specify a timeout before exiting, and tests.

The exit status will be 124, as the timeout(1) utility uses.

Reviewed by: jilles
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9697

7 years agoFix booting with >4GB RAM on PowerMac G5 hardware
Justin Hibbits [Tue, 7 Mar 2017 22:11:57 +0000 (22:11 +0000)]
Fix booting with >4GB RAM on PowerMac G5 hardware

===
From Nathan Whitehorn:

Open Firmware runs in virtual mode on the Powermac G5. This runs inside the
kernel page table, which preserves all address translations made by OF before
the kernel starts; as a result, the kernel address space is a strict superset of
OF's.

Where this explodes is if OF uses an unmapped SLB entry. The SLB fault handler
runs in real mode and refers to the PCPU pointer in SPRG0, which blows up the
kernel. Having a value of SPRG0 that works for the kernel is less fatal than
preserving OF's value in this case.

===

The result of this is seemingly random panics from NULL dereferences, or hangs
immediately upon boot.  By not restoring SPRG0 for Open Firmware entry the
kernel PCPU pointer is preserved and SLB faults are successful, resulting in a
stable kernel.

PR: 205458
Reported by: several (over bugzilla, lists, IRC)
Reviewed by: andreast
Tested by: many (various forms)
MFC after: 2 weeks

7 years agoMake multi-namespace nvme drives more robust.
Warner Losh [Tue, 7 Mar 2017 21:47:54 +0000 (21:47 +0000)]
Make multi-namespace nvme drives more robust.

Fix assumptions about name spaces in NVME driver. First, it assumes
cdata.nn is the number of configured devices. However, it is the
number of supported name spaces. Second, it assumes that there will
never be more than 16 name spaces supported, but a certain drive I'm
testing reports 1024. It assumes that name spaces are a tightly packed
namespace, but the standard seems to indicate otherwise. Finally, it
assumes that an error would be generated when quearying an
unconfigured namespace. Instead, it succeeds but the identify data is
all zeros.

Fix these by limiting the number of name spaces we probe to 16. Remove
aborting when we find one in error. When the size of the name space is
zero, ignore it.

This is admittedly a bandaide. The long term fix will be to
participate in the enumeration and name space change protocols
definfed in the NVNe standard.

Sponsored by: Netflix

7 years agoufsread: Use appropriate UFS_MAXNAMLEN constant
Conrad Meyer [Tue, 7 Mar 2017 21:40:01 +0000 (21:40 +0000)]
ufsread: Use appropriate UFS_MAXNAMLEN constant

A follow-up to r313475.

Submitted by: Gaurav Gangalwar <Gaurav.Gangalwar at emc.com>
Sponsored by: Dell EMC Isilon

7 years agoBring in snapshot of the MdePkg from Tianocore's EDK2 project at git
Warner Losh [Tue, 7 Mar 2017 20:53:26 +0000 (20:53 +0000)]
Bring in snapshot of the MdePkg from Tianocore's EDK2 project at git
hash 7babb4372e6a34cbbc54249b25056272a5a9924c From 2017-Mar-03.

EDK2 is Intel's BSD Licensed UEFI implementation. We'll be bringing in
various routines from there rather than reimplementing them from
scratch for libefivar and the EFI boot loader.

The upstream repo has ^M ending on everything (sometimes multiple
times!), so the following script was run prior to import so changes we
have to do don't first include changing every line:

% find . -type f | xargs -n 1 sed -I.BAK -e `printf "s/\r//g"`
% find . -name \*.BAK | xargs rm

Also, only the MdePkg was brought in (it's 17MB, while the entire repo
is 250MB). It's almost completely certain nothing else will be used,
but if it is, it can be brough in along side MdePkg in the future.

Obtained from: https://github.com/tianocore/edk2.git

7 years agoAdd support for constant pointer constructs to READ_ONCE() in the
Hans Petter Selasky [Tue, 7 Mar 2017 20:24:34 +0000 (20:24 +0000)]
Add support for constant pointer constructs to READ_ONCE() in the
LinuxKPI. When the type of the argument is constant the temporary
variable cannot be assigned after the barrier. Instead assign the
temporary variable by initialization.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agolpr(1): small bounds check with reallocarray(3).
Pedro F. Giffuni [Tue, 7 Mar 2017 19:30:22 +0000 (19:30 +0000)]
lpr(1): small bounds check with reallocarray(3).

While here plug a memory leak upon error and postpose a multiplication
until after reallocation has succeded.

Hinted partially by: OpenBSD
Reviewed by: gad
MFC after: 2 weeks

7 years agom_mbuftouio() doesn't modify the mbuf.
Gleb Smirnoff [Tue, 7 Mar 2017 19:00:50 +0000 (19:00 +0000)]
m_mbuftouio() doesn't modify the mbuf.

7 years agoCatch up with Clang 4.0.0.
Jung-uk Kim [Tue, 7 Mar 2017 19:00:27 +0000 (19:00 +0000)]
Catch up with Clang 4.0.0.

7 years agoAdd bsd.man.mk references for MAN under bsd.lib.mk and bsd.prog.mk
Enji Cooper [Tue, 7 Mar 2017 17:53:53 +0000 (17:53 +0000)]
Add bsd.man.mk references for MAN under bsd.lib.mk and bsd.prog.mk

The latter set of manpages directly consume bsd.man.mk, so the bsd.man.mk
behavior should be the source of truth for underlying behavior, whereas
the other manpage fragment descriptions should document how they tweak
the variable behavior, if at all (bsd.prog.mk does tweak the default
value, as noted in its description)

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoFix LINKS example in bsd.prog.mk
Enji Cooper [Tue, 7 Mar 2017 17:42:23 +0000 (17:42 +0000)]
Fix LINKS example in bsd.prog.mk

LINKS appends DESTDIR -- don't suggest double-append in example.

MFC after: 1 week
Reported by: rgrimes (D9918)
Sponsored by: Dell EMC Isilon

7 years agoAdd mechanism to unload CAM periph drivers.
Alexander Motin [Tue, 7 Mar 2017 17:41:08 +0000 (17:41 +0000)]
Add mechanism to unload CAM periph drivers.

For now it allows to unload CTL kernel module if there are no target-capable
SIMs in CAM.  As next step full teardown of CAM targets can be implemented.

7 years agoAlphabetically sort variables
Enji Cooper [Tue, 7 Mar 2017 17:38:52 +0000 (17:38 +0000)]
Alphabetically sort variables

The only content change is minor rewording around CLEANDIRS/CLEANFILES to
accomodate sorting order.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoLinux semop system call return EINVAL in case when the invalid nsops
Dmitry Chagin [Tue, 7 Mar 2017 17:12:22 +0000 (17:12 +0000)]
Linux semop system call return EINVAL in case when the invalid nsops
or semid values specified.

MFC after: 1 month

7 years agoLinux kernel does not export to the user space ipc_perm.mode values
Dmitry Chagin [Tue, 7 Mar 2017 17:09:12 +0000 (17:09 +0000)]
Linux kernel does not export to the user space ipc_perm.mode values
other than S_IRWXUGO (0777).

MFC after: 1 month

7 years agoReduce code duplication between MD Linux code by moving SYSV IPC 64-bit
Dmitry Chagin [Tue, 7 Mar 2017 17:07:16 +0000 (17:07 +0000)]
Reduce code duplication between MD Linux code by moving SYSV IPC 64-bit
related struct definitions out into the MI path.

Invert the native ipc structs to the Linux ipc structs convesion logic.
Since 64-bit variant of ipc structs has more precision convert native ipc
structs to the 64-bit Linux ipc structs and then truncate 64-bit values
into the non 64-bit if needed. Unlike Linux, return EOVERFLOW if the
values do not fit.

Fix SYSV IPC for 64-bit Linuxulator which never sets IPC_64 bit.

MFC after: 1 month

7 years agoBump __FreeBSD_version for removal of pcap-int.h.
Xin LI [Tue, 7 Mar 2017 16:09:37 +0000 (16:09 +0000)]
Bump __FreeBSD_version for removal of pcap-int.h.

PR: 217221

7 years agofirewire/sbp: try to improve locking, plus a few style nits
Andriy Gapon [Tue, 7 Mar 2017 16:07:52 +0000 (16:07 +0000)]
firewire/sbp: try to improve locking, plus a few style nits

This change tries to fix the most obvious locking problems.

sbp_cam_scan_lun() is never called with the sbp lock held, so the lock
needs to be acquired internally (if it's needed at all).
Without this change a kernel with INVARIANTS panics when a firewire disk
is connected:
  panic: mutex sbp not owned at /usr/src/sys/dev/firewire/sbp.c:967
  KDB: stack backtrace:
  db_trace_self_wrapper() at 0xffffffff80420bbb = db_trace_self_wrapper+0x2b/frame 0xfffffe0504df0930
  kdb_backtrace() at 0xffffffff80670359 = kdb_backtrace+0x39/frame 0xfffffe0504df09e0
  vpanic() at 0xffffffff8063986c = vpanic+0x14c/frame 0xfffffe0504df0a20
  panic() at 0xffffffff806395b3 = panic+0x43/frame 0xfffffe0504df0a80
  __mtx_assert() at 0xffffffff8061c40d = __mtx_assert+0xed/frame 0xfffffe0504df0ac0
  sbp_cam_scan_lun() at 0xffffffff80474667 = sbp_cam_scan_lun+0x37/frame 0xfffffe0504df0af0
  xpt_done_process() at 0xffffffff802aacfa = xpt_done_process+0x2da/frame 0xfffffe0504df0b30
  xpt_done_td() at 0xffffffff802ac2e5 = xpt_done_td+0xd5/frame 0xfffffe0504df0b80
  fork_exit() at 0xffffffff805ff72f = fork_exit+0xdf/frame 0xfffffe0504df0bf0
  fork_trampoline() at 0xffffffff8082483e = fork_trampoline+0xe/frame
  0xfffffe0504df0bf0
  --- trap 0, rip = 0, rsp = 0, rbp = 0 ---

Also, I tried to reduce the scope of the sbp lock to avoid holding it
while doing bus_dma allocations.

The code badly needs some re-engineering.  SBP really should implement
a CAM transport, so that it avoids control flow inversion when re-scanning
the bus.  Also, the sbp lock seems to be too coarse.

Additionally, the commit includes some changes not related to locking.

- sbp_cam_scan_lun: restore CAM_DEV_QFREEZE before re-queueing the ccb
  because xpt_setup_ccb resets ccb_h.flags
- sbp_post_busreset: call xpt_release_simq only if it's actually frozen
- don't place private SIMQ_FREEZED flag (sic, "freezed") into sim->flags,
  use sbp->flags for that
- some style fixes and control flow enhancements

Reviewed by: sbruno
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9898

7 years agoStop installing pcap-int.h, which is the internal interface for libpcap.
Xin LI [Tue, 7 Mar 2017 16:06:53 +0000 (16:06 +0000)]
Stop installing pcap-int.h, which is the internal interface for libpcap.

Reference: https://github.com/the-tcpdump-group/libpcap/issues/560
PR: 217221

7 years agoqlxgbe: add GCC_MS_EXTENSIONS to CFLAGS to make old base GCC happy
Andriy Gapon [Tue, 7 Mar 2017 15:43:49 +0000 (15:43 +0000)]
qlxgbe: add GCC_MS_EXTENSIONS to CFLAGS to make old base GCC happy

The module uses unnamed structure and union fields and base GCC in
stable/10 doesn't like it.
I think that that is a C11 feature, so it is courteous of more modern
compilers to not complain about it when compiling in C99 mode.

Approved by: davidcs
MFC after: 5 days

7 years agoImplement time_is_after_eq_jiffies() function in the LinuxKPI.
Hans Petter Selasky [Tue, 7 Mar 2017 15:37:51 +0000 (15:37 +0000)]
Implement time_is_after_eq_jiffies() function in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix implementation of the DECLARE_RWSEM() macro in the LinuxKPI.
Hans Petter Selasky [Tue, 7 Mar 2017 15:34:49 +0000 (15:34 +0000)]
Fix implementation of the DECLARE_RWSEM() macro in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoMake sure jiffies value is cast to an integer in the LinuxKPI before
Hans Petter Selasky [Tue, 7 Mar 2017 15:33:38 +0000 (15:33 +0000)]
Make sure jiffies value is cast to an integer in the LinuxKPI before
doing millisecond conversion. Under FreeBSD jiffies are 32-bit.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoUpdate our Allwinner DTS to latest DTS changes in Linux 4.10
Emmanuel Vadot [Tue, 7 Mar 2017 13:59:30 +0000 (13:59 +0000)]
Update our Allwinner DTS to latest DTS changes in Linux 4.10

7 years agoUpdate our device tree files to a Linux 4.10
Emmanuel Vadot [Tue, 7 Mar 2017 13:56:49 +0000 (13:56 +0000)]
Update our device tree files to a Linux 4.10

7 years agoUse grouptaskqueue for tasklets in the LinuxKPI.
Hans Petter Selasky [Tue, 7 Mar 2017 13:51:14 +0000 (13:51 +0000)]
Use grouptaskqueue for tasklets in the LinuxKPI.

This avoids creating own per-CPU threads and also ensures the tasklet
execution happens on the same CPU core invoking the tasklet.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agodon't stop in issignal() if P_SINGLE_EXIT is set
Eric Badger [Tue, 7 Mar 2017 13:41:01 +0000 (13:41 +0000)]
don't stop in issignal() if P_SINGLE_EXIT is set

Suppose a traced process is stopped in ptracestop() due to receipt of a
SIGSTOP signal, and is awaiting orders from the tracing process on how
to handle the signal. Before sending any such orders, the tracing
process exits. This should kill the traced process. But suppose a second
thread handles the SIGKILL and proceeds to exit1(), calling
thread_single(). The first thread will now awaken and will have a chance
to check once more if it should go to sleep due to the SIGSTOP.  It must
not sleep after P_SINGLE_EXIT has been set; this would prevent the
SIGKILL from taking effect, leaving a stopped orphan behind after the
tracing process dies.

Also add new tests for this condition.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D9890

7 years agoWhen selecting brand based on old Elf branding, prefer the brand which
Konstantin Belousov [Tue, 7 Mar 2017 13:38:25 +0000 (13:38 +0000)]
When selecting brand based on old Elf branding, prefer the brand which
interpreter exactly matches the one requested by the activated image.

This change applies r295277, which did the same for note branding, to
the old brand selection, with the same reasoning of fixing compat32
interpreter substitution.

PR: 211837
Reported by: kenji@kens.fm
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRequire whole brand string matching for old Elf branding.
Konstantin Belousov [Tue, 7 Mar 2017 13:37:35 +0000 (13:37 +0000)]
Require whole brand string matching for old Elf branding.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoConsistently use vm_ooffset_t type for the vm object offset in
Konstantin Belousov [Tue, 7 Mar 2017 13:36:43 +0000 (13:36 +0000)]
Consistently use vm_ooffset_t type for the vm object offset in
elf_load_section.

The values passed currently as vm_offset_t are phdr.p_offset, which
have the native Elf word size.  Since elf_load_section interprets them
as the file offset, use vm object offset type.

Noted and reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUpdate to Linux 4.10
Emmanuel Vadot [Tue, 7 Mar 2017 12:41:06 +0000 (12:41 +0000)]
Update to Linux 4.10

7 years agoLinuxKPI workqueue cleanup.
Hans Petter Selasky [Tue, 7 Mar 2017 12:09:14 +0000 (12:09 +0000)]
LinuxKPI workqueue cleanup.

This change makes the workqueue implementation behave more like in
Linux, both functionality wise and structure wise.

All workqueue code has been moved to linux_work.c

Add an atomic based statemachine to the work_struct to ensure proper
operation. Prior to this change struct_work was directly mapped to a
FreeBSD task. When a taskqueue has multiple threads the same task may
end up being executed on more than one worker thread simultaneously.
This might cause problems with code coming from Linux, which expects
serial behaviour, similar to Linux tasklets.

Move all global workqueue function names into the linux_xxx domain to
avoid symbol name clashes in the future.

Implement a few more workqueue related functions and macros.

Create two multithreaded taskqueues for the LinuxKPI during module
load, one for time-consuming callbacks and one for non-time consuming
callbacks.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoxen/netfront: fix inbound packet flags for checksum offload
Roger Pau Monné [Tue, 7 Mar 2017 09:18:52 +0000 (09:18 +0000)]
xen/netfront: fix inbound packet flags for checksum offload

Currently netfront is setting the flags of inbound packets with the checksum
not present (offloaded) to (CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID |
CSUM_PSEUDO_HDR). According to the mbuf(9) man page this is not the correct
combination of flags, it should instead be (CSUM_DATA_VALID |
CSUM_PSEUDO_HDR).

Reviewed by: Wei Liu <wei.liu2@citrix.com>
MFC after: 2 weeks
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D9831

7 years agoxenstore: fix suspension when using the xenstore device
Roger Pau Monné [Tue, 7 Mar 2017 09:17:48 +0000 (09:17 +0000)]
xenstore: fix suspension when using the xenstore device

Lock the xenstore request mutex when suspending user-space processes, in order
to prevent any process from holding this lock when going into suspension, or
else the xenstore suspend process is going to deadlock.

Submitted by: Liuyingdong <liuyingdong@huawei.com>
Reviewed by: royger
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D9638

7 years agoxen: add support for canceled suspend
Roger Pau Monné [Tue, 7 Mar 2017 09:16:51 +0000 (09:16 +0000)]
xen: add support for canceled suspend

When running on Xen, it's possible that a suspend request to the hypervisor
fails (return from HYPERVISOR_suspend different than 0). This means that the
suspend hasn't succeed, and the resume procedure needs to properly handle this
case.

First of all, when such situation happens there's no need to reset the vector
callback, hypercall page, shared info, event channels or grant table, because
it's state is preserved. Also, the PV drivers don't need to be reset to the
initial state, since the connection with the backed has not been interrupted.

Submitted by: Liuyingdong <liuyingdong@huawei.com>
Reviewed by: royger
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D9635

7 years agoiwn: deduplicate (RXON + txpower + broadcast node) command sequence.
Andriy Voskoboinyk [Tue, 7 Mar 2017 07:49:25 +0000 (07:49 +0000)]
iwn: deduplicate (RXON + txpower + broadcast node) command sequence.

Was previously applied to wpi(4) as a part of r278366.

Tested with Intel 6205, STA / MONITOR modes.

7 years agoFix the KASSERT check from r314813.
Hiren Panchasara [Tue, 7 Mar 2017 06:46:38 +0000 (06:46 +0000)]
Fix the KASSERT check from r314813.
len being 0 is valid.

Submitted by: ngie
Reported by: ngie (via jenkins test run)
Sponsored by: Limelight Networks

7 years agoThe relative symlink fix causes downstream issues for
Rodney W. Grimes [Tue, 7 Mar 2017 06:11:36 +0000 (06:11 +0000)]
The relative symlink fix causes downstream issues for
EMC DELL Isilon so revert the relative symlink fix
pending a better solution.

Reported by: ngie
Approved by: greham (mentor) Implicit as reverting
MFC after: 1 week