]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoImplement address space guards.
kib [Sat, 24 Jun 2017 17:01:11 +0000 (17:01 +0000)]
Implement address space guards.

Guard, requested by the MAP_GUARD mmap(2) flag, prevents the reuse of
the allocated address space, but does not allow instantiation of the
pages in the range.  It is useful for more explicit support for usual
two-stage reserve then commit allocators, since it prevents accidental
instantiation of the mapping, e.g. by mprotect(2).

Use guards to reimplement stack grow code.  Explicitely track stack
grow area with the guard, including the stack guard page.  On stack
grow, trivial shift of the guard map entry and stack map entry limits
makes the stack expansion.  Move the code to detect stack grow and
call vm_map_growstack(), from vm_fault() into vm_map_lookup().

As result, it is impossible to get random mapping to occur in the
stack grow area, or to overlap the stack guard page.

Enable stack guard page by default.

Reviewed by: alc, markj
Man page update reviewed by: alc, bjk, emaste, markj, pho
Tested by: pho, Qualys
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D11306 (man pages)

7 years agoDo not try to unmark MAP_ENTRY_IN_TRANSITION marked by other thread.
kib [Sat, 24 Jun 2017 16:47:41 +0000 (16:47 +0000)]
Do not try to unmark MAP_ENTRY_IN_TRANSITION marked by other thread.

The issue is catched by "vm_map_wire: alien wire" KASSERT at the end
of the vm_map_wire().  We currently check for MAP_ENTRY_WIRE_SKIPPED
flag before ensuring that the wiring_thread is curthread. For HOLESOK
wiring, this means that we might see WIRE_SKIPPED entry from different
wiring.

The fix it by only checking WIRE_SKIPPED if the entry is put
IN_TRANSITION by us.  Also fixed a typo in the comment explaining the
situation.

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

7 years agoAllwinner: Add support for H2 Plus SoC
manu [Sat, 24 Jun 2017 16:41:26 +0000 (16:41 +0000)]
Allwinner: Add support for H2 Plus SoC

H2+ SoC is a stripped down version of H3 without gigabit ethernet and 4K HDMI.
Also add sun8i-h2-plus-orangepi-zero.dts to the build as we run on this board.

7 years agoRemove the description of MAP_HASSEMAPHORE.
kib [Sat, 24 Jun 2017 16:36:30 +0000 (16:36 +0000)]
Remove the description of MAP_HASSEMAPHORE.

The flag is not implemented, all FreeBSD architectures correctly
handle locks on normal cacheable mappings.  On the other hand, the
flag was specified by some software, so it is kept in the header as
nop.  Removal from the man page should discourage its use.

Reviewed by: alc, bjk, emaste, markj, pho
MFC after: 3 days
X-Differential revision: https://reviews.freebsd.org/D11306

7 years agoFix typo.
kib [Sat, 24 Jun 2017 16:21:34 +0000 (16:21 +0000)]
Fix typo.

Noted by: alc
MFC after: 3 days

7 years agoDocument that the dependencies aren't quite right for non-clean build.
imp [Sat, 24 Jun 2017 14:32:57 +0000 (14:32 +0000)]
Document that the dependencies aren't quite right for non-clean build.

7 years agoTranslate between abridged and full x87 tags for compat32
kib [Sat, 24 Jun 2017 11:38:31 +0000 (11:38 +0000)]
Translate between abridged and full x87 tags for compat32
ptrace(PT_GETFPREGS).

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFix indent.
kib [Sat, 24 Jun 2017 10:19:06 +0000 (10:19 +0000)]
Fix indent.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoloader.efi: Disable smbios for arm
manu [Sat, 24 Jun 2017 09:33:25 +0000 (09:33 +0000)]
loader.efi: Disable smbios for arm

The smbios code does a lot of unaligned access, since we don't really
care about smbios info on ARM (not all board expose information and those
who does don't expose useful ones) disable smbios for this arch (at least
for now).

7 years agoBe sure to free allocated statfs11 buffer.
imp [Sat, 24 Jun 2017 00:28:35 +0000 (00:28 +0000)]
Be sure to free allocated statfs11 buffer.

Submitted by: Alistair Crooks

7 years agoDoh, fix some botched "fix" in r320277.
sobomax [Fri, 23 Jun 2017 23:11:05 +0000 (23:11 +0000)]
Doh, fix some botched "fix" in r320277.

Reported by: cem
MFC after: 6 weeks

7 years agoHandle sctp_get_next_param() in a consistent way.
tuexen [Fri, 23 Jun 2017 21:01:57 +0000 (21:01 +0000)]
Handle sctp_get_next_param() in a consistent way.

This addresses an issue found by Felix Weinrank using libfuzz.
While there, use also consistent nameing.

MFC after: 3 days

7 years agodtc: Update to upstream 9ce35ff8
manu [Fri, 23 Jun 2017 20:21:53 +0000 (20:21 +0000)]
dtc: Update to upstream 9ce35ff8

 - Add "compatible with gpl dtc X.Y.Z" to version output so U-Boot doesn't complain
 - Fix cross reference node

This fixes some Allwinner DTS (and probably others).

7 years agoNO_ROOT: Remove excessive // when DESTDIR/DISTDIR are empty.
bdrewery [Fri, 23 Jun 2017 19:03:31 +0000 (19:03 +0000)]
NO_ROOT: Remove excessive // when DESTDIR/DISTDIR are empty.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agomakefs: add copies of NetBSD makefs msdos source files
emaste [Fri, 23 Jun 2017 18:58:28 +0000 (18:58 +0000)]
makefs: add copies of NetBSD makefs msdos source files

We do not treat makefs as contrib code.  Import copies of makefs msdos
files from NetBSD so that we can track our changes to these files.

These are copied from NetBSD, with only a change to use __FBSDID and
$FreeBSD$ instead of __KERNEL_RCSID and $NetBSD$.  A copy of the
original $NetBSD$ tag remains in each source file.

These two files were missed in r320212.  Also remove a stray blank line
added in msdosfs_vfsops.c.

Submitted by: Siva Mahadevan
Sponsored by: The FreeBSD Foundation

7 years agoInclude WORLD_FLAGS in CHROOT_IMAKEFLAGS and CHROOT_DMAKEFLAGS, to
gjb [Fri, 23 Jun 2017 18:42:47 +0000 (18:42 +0000)]
Include WORLD_FLAGS in CHROOT_IMAKEFLAGS and CHROOT_DMAKEFLAGS, to
allow passing '-jN' to the installworld and distributeworld targets.

Submitted by: bdrewery
Sponsored by: The FreeBSD Foundation

7 years agoAllow Clang's integrated assembler to assemble boot0
emaste [Fri, 23 Jun 2017 18:41:49 +0000 (18:41 +0000)]
Allow Clang's integrated assembler to assemble boot0

dim@ compared clang IAS-built and GNU as-built boot0 and found them
equivalent.  IAS encoded one instruction using two bytes where GNU as
used three, and another instruction using three bytes where GNU as used
two.  The net result is equivalent and tested, so there is no need to
force IAS off for boot0.

7 years agoRemove redundant wording, minor edits for clarity.
wblock [Fri, 23 Jun 2017 18:38:27 +0000 (18:38 +0000)]
Remove redundant wording, minor edits for clarity.

MFC after: 1 week
Sponsored by: iXsystems

7 years agocompiler-metadata: Properly handle cross-build OBJDIR.
bdrewery [Fri, 23 Jun 2017 18:27:03 +0000 (18:27 +0000)]
compiler-metadata: Properly handle cross-build OBJDIR.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoExpose only the create-packages-* targets since they set needed DEST/DIRDIR.
bdrewery [Fri, 23 Jun 2017 18:27:00 +0000 (18:27 +0000)]
Expose only the create-packages-* targets since they set needed DEST/DIRDIR.

The other targets just fail confusingly otherwise.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agopackages: Parallelize individual kernel packaging.
bdrewery [Fri, 23 Jun 2017 18:26:57 +0000 (18:26 +0000)]
packages: Parallelize individual kernel packaging.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agopackages: Allow actually building individual world packages in parallel.
bdrewery [Fri, 23 Jun 2017 18:26:54 +0000 (18:26 +0000)]
packages: Allow actually building individual world packages in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agopackages: Allow creating kernel/world packages in parallel.
bdrewery [Fri, 23 Jun 2017 18:26:51 +0000 (18:26 +0000)]
packages: Allow creating kernel/world packages in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agopackages: Allow staging world/kernel in parallel.
bdrewery [Fri, 23 Jun 2017 18:26:47 +0000 (18:26 +0000)]
packages: Allow staging world/kernel in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agopackages: Allow stageworld/stagekernel to run with make jobs.
bdrewery [Fri, 23 Jun 2017 18:26:33 +0000 (18:26 +0000)]
packages: Allow stageworld/stagekernel to run with make jobs.

The -B was originally added in projects/release-pkg r289381 as a copy
of what 'make world' did at the time.  The -B was removed from
the 'installworld' call in 'world' in r303844 though.  The staging
of files is safe to run in parallel.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoDecode FreeBSD 11 compat stat, fstat and lstat calls.
imp [Fri, 23 Jun 2017 18:06:46 +0000 (18:06 +0000)]
Decode FreeBSD 11 compat stat, fstat and lstat calls.

7 years agoForward compatibility for ino64.
imp [Fri, 23 Jun 2017 18:06:20 +0000 (18:06 +0000)]
Forward compatibility for ino64.

Add forward compatibility so that new binaries can run on old
kernels. If the new system call from ino64 isn't available on your
system, then the old one will be used and the results translated.  The
stat and statfs families of functions are fully emulated. While not
required by policy, in this case it is helpful to our users to provide
this compatibility. In this case, it allows rollback of the kernel
after installing a new userland should a problem be discovered. It
also prevents foot-shooting if a user does an install before rebooting
with the new kernel. Finally, it allows the use case where one needs
to run new binaries on an old kernel as part of an upgrade process.

The getdirentries family uses tricks that may not work on remote
filesystems. Specifically, it uses a buffer 1/4 the size requested to
get the data from he old syscall.

The code carefully uses direct syscalls for old system calls to avoid
referencing freebsd11_* symbols, which contaminate ld-elf.so.1's
export table due to its use of stat functions, which causes errno to
be incorrect in client programs due to the wrong *stat* function being
resolved in some cases.

This code should removed sometime after 12 is branched.

Tested on: 12-current binaries on a 10.3-beta kernel run and return
       consistent results. 12-current kernel and userland with
       packages from before ino64 was committed also work.

Differential Revision: https://reviews.freebsd.org/D11185
Reviewed by: kib@, emaste@

7 years agoDon't leak file descriptor in some cases.
sobomax [Fri, 23 Jun 2017 17:39:00 +0000 (17:39 +0000)]
Don't leak file descriptor in some cases.

Reported by: cem
MFC after: 6 weeks

7 years agoipfw: Note that bandwidth can take G suffix in the manpage
manu [Fri, 23 Jun 2017 17:31:07 +0000 (17:31 +0000)]
ipfw: Note that bandwidth can take G suffix in the manpage

Reported by: Jose Luis Duran (github)

7 years agoIntroduce LINKER_FEATURES to avoid duplicating version logic
emaste [Fri, 23 Jun 2017 17:21:37 +0000 (17:21 +0000)]
Introduce LINKER_FEATURES to avoid duplicating version logic

Submitted by: bdrewery
Reported by: kib

7 years agoSet compiler metadata for stageworld/distributeworld.
bdrewery [Fri, 23 Jun 2017 16:38:46 +0000 (16:38 +0000)]
Set compiler metadata for stageworld/distributeworld.

This fixes LD errors during 'make packages' but also for the unlikely case of
'buildworld' on 1 system and 'packages' on another [1].

PR: 212877 [1]
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoAllow ALWAYS_BOOTSTRAP_MAKE to force bmake bootstrapping.
bdrewery [Fri, 23 Jun 2017 16:38:18 +0000 (16:38 +0000)]
Allow ALWAYS_BOOTSTRAP_MAKE to force bmake bootstrapping.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoenable --build-id for the kernel link
emaste [Fri, 23 Jun 2017 15:57:58 +0000 (15:57 +0000)]
enable --build-id for the kernel link

A Build-ID is an identifier generated at link time to uniquely identify
ELF binaries.  It allows efficient confirmation that an executable or
shared library and a corresponding standalone debuginfo file match.
(Otherwise, a checksum of the debuginfo file must be calculated when
opening it in a debugger.)

The FreeBSD base system includes GNU bfd ld 2.17.50 as the linker for
architectures other than arm64.  Build-ID support was added to bfd ld
shortly after that version, so was not previously available to us.

We can now start making use of Build-ID as we migrate to using lld or
bfd ld from ports, conditionally enabled based on the LINKER_TYPE and
LINKER_VERSION make variables added in r320244 and subsequent commits.

Reviewed by: dim
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11314

7 years agosesutil no longer depends on libsbuf
bapt [Fri, 23 Jun 2017 15:27:23 +0000 (15:27 +0000)]
sesutil no longer depends on libsbuf

Sponsored by: Gandi.net

7 years agoDirectly print the extra status instead of filling a buffer
bapt [Fri, 23 Jun 2017 15:09:08 +0000 (15:09 +0000)]
Directly print the extra status instead of filling a buffer
then printing it.

This prepares the code to make it libxo friendly

Reviewed by: manu, Nikita Kozlov (nikita elyzion.net)
MFC after: 2 weeks
Sponsored by: Gandi.net

7 years agostyle fixes in bin/echo/tests
asomers [Fri, 23 Jun 2017 15:02:49 +0000 (15:02 +0000)]
style fixes in bin/echo/tests

Submitted by: shivansh
Reviewed by: asomers
MFC after: 2 weeks
X-MFC-With: 319626
Sponsored by: Google, Inc (GSoC 2017)
Differential Revision: https://reviews.freebsd.org/D11318

7 years agoipfw: dummynet: Add 'G' and 'g' suffix for bandwidth configuration/display
manu [Fri, 23 Jun 2017 14:00:28 +0000 (14:00 +0000)]
ipfw: dummynet: Add 'G' and 'g' suffix for bandwidth configuration/display

MFC after: 2 weeks
Sponsored by: Gandi.net

7 years agoDo not use sprintf(3) when not needed, while here,
bapt [Fri, 23 Jun 2017 13:26:13 +0000 (13:26 +0000)]
Do not use sprintf(3) when not needed, while here,
prefer snprintf(3) over sprintf(3)

7 years agojedec_ts: add support for devices manufactured by IDT
avg [Fri, 23 Jun 2017 11:55:43 +0000 (11:55 +0000)]
jedec_ts: add support for devices manufactured by IDT

Full manufacturer name is Integrated Device Technology, Inc.
Supported devices include TSE2002B3C and TS3000B3A.

MFC after: 1 week

7 years agoFix caveat in new implementation of linprocfs_docpuinfo():
mmokhi [Fri, 23 Jun 2017 10:36:27 +0000 (10:36 +0000)]
Fix caveat in new implementation of linprocfs_docpuinfo():
Prevent kernel panic in case that extended-cpuid isn't supported by CPU

Reviewed by: kib, ngie, trasz
Approved by: trasz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11294

7 years agoCheck the length of a COOKIE chunk before accessing fields in it.
tuexen [Fri, 23 Jun 2017 10:09:49 +0000 (10:09 +0000)]
Check the length of a COOKIE chunk before accessing fields in it.

Thanks to Felix Weinrank for reporting the issue he found by using
libFuzzer.

MFC after: 3 days

7 years agoUse a longer buffer for messages in ERROR chunks.
tuexen [Fri, 23 Jun 2017 09:27:31 +0000 (09:27 +0000)]
Use a longer buffer for messages in ERROR chunks.

This allows them to be sent in a non truncated way and addresses a warning
given by newver versions of gcc.
Thanks to Anselm Jonas Scholl for reporting it and providing a patch.

7 years agofix gcc-specific fallout from r320156, MFV of r318946, ZFS ABD
avg [Fri, 23 Jun 2017 08:42:53 +0000 (08:42 +0000)]
fix gcc-specific fallout from r320156, MFV of r318946, ZFS ABD

Reported by: jhibbits
MFC after: 1 week
X-MFC with: r320156

7 years agoHonor the backlog field.
tuexen [Fri, 23 Jun 2017 08:35:54 +0000 (08:35 +0000)]
Honor the backlog field.

7 years agoImprove compilation on platforms different from FreeBSD.
tuexen [Fri, 23 Jun 2017 08:34:01 +0000 (08:34 +0000)]
Improve compilation on platforms different from FreeBSD.

7 years agojedec_ts: read device id from the correct register
avg [Fri, 23 Jun 2017 06:25:39 +0000 (06:25 +0000)]
jedec_ts: read device id from the correct register

Due to my braino / typo the driver was reading the Vendor ID register
twice.

MFC after: 3 days

7 years agochange GNU ld LINKER_TYPE from binutils to bfd
emaste [Fri, 23 Jun 2017 03:55:00 +0000 (03:55 +0000)]
change GNU ld LINKER_TYPE from binutils to bfd

GNU binutils includes two linkers: ld.bfd and ld.gold.  For clarity use
LINKER_TYPE=bfd to refer to ld.bfd, the original binutils linker that
identifies itself as "GNU ld".

Discussed with: bdrewery

7 years agoReplace AF_INET6 ifdefs with USE_INET6 ifdefs. This is more consistent
cy [Fri, 23 Jun 2017 02:42:04 +0000 (02:42 +0000)]
Replace AF_INET6 ifdefs with USE_INET6 ifdefs. This is more consistent
and guaranteed to build everywhere in ipfilter.

Not all of this commit can be MFCed. Some is original code while others
are not.

7 years agoReplace the leap-seconds file in r320242 from USNO -
cy [Fri, 23 Jun 2017 01:05:49 +0000 (01:05 +0000)]
Replace the leap-seconds file in r320242 from USNO -
ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3701462400 - with a
leap-seconds file from NIST at ftp://time.nist.gov/pub/. The USNO
version of the file changes the last documented leap second update
time whereas the NIST version does not. The expiration of the USNO
version of the file is also one month short.

Requested by: ian@
Obtained from: ftp://time.nist.gov/pub/leap-seconds.3676924800
MFC after: 3 days

7 years agoClarify usage of aio(4) with kqueue(2)
asomers [Fri, 23 Jun 2017 00:40:09 +0000 (00:40 +0000)]
Clarify usage of aio(4) with kqueue(2)

Reviewed by: jhb
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D11299

7 years agoFix, for the fourth or fifth time now, looking up where boot1.efi
gjb [Fri, 23 Jun 2017 00:27:40 +0000 (00:27 +0000)]
Fix, for the fourth or fifth time now, looking up where boot1.efi
is located.

MFC after: 5 days
X-MFC-Note: maybe
X-MFC-With: r320252, r320253
Sponsored by: The FreeBSD Foundation

7 years agoRemove two configuration entries used for debugging that snuck in.
gjb [Fri, 23 Jun 2017 00:11:34 +0000 (00:11 +0000)]
Remove two configuration entries used for debugging that snuck in.

MFC after: 5 days
X-MFC-Note: maybe
X-MFC-With: r320252
Sponsored by: The FreeBSD Foundation

7 years agoIn release/release.sh:
gjb [Fri, 23 Jun 2017 00:08:36 +0000 (00:08 +0000)]
In release/release.sh:
- Rename chroot_arm_armv6_build_release() to chroot_arm_build_release()
  and make it hardware agnostic (such as armv6 -vs- armv7 -vs- arm64).

- Evaluate EMBEDDED_TARGET differently so release/tools/arm.subr can
  be used for arm/armv6 and arm64/aarch64.

- Update comments and copyright.

In release/tools/arm.subr:
- In arm_create_disk(), change the default alignment from 63 to 512k,
  fixing a boot issue on arm64 and EFI. [1]

- Update comments and copyright.

Add a RPI3 configuration file, pieces obtained from Crochet.

Obtained from: Crochet [1]
MFC after: 5 days
X-MFC-Note: maybe
Sponsored by: The FreeBSD Foundation

7 years agoProvide proper values for X_LINKER_TYPE/VERSION when XLD == LD.
bdrewery [Thu, 22 Jun 2017 22:53:10 +0000 (22:53 +0000)]
Provide proper values for X_LINKER_TYPE/VERSION when XLD == LD.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoDon't overwrite already-set LINKER_VERSION/LINKER_TYPE.
bdrewery [Thu, 22 Jun 2017 22:53:07 +0000 (22:53 +0000)]
Don't overwrite already-set LINKER_VERSION/LINKER_TYPE.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoLINKER_VERSION: Support external binutils.
bdrewery [Thu, 22 Jun 2017 21:22:12 +0000 (21:22 +0000)]
LINKER_VERSION: Support external binutils.

The ports binutils stores the version in the 5th word so just look for
a version using a pattern instead.

Reported by: rpokala
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoPass along LINKER_* vars during installworld and show in test-system-compiler.
bdrewery [Thu, 22 Jun 2017 21:03:30 +0000 (21:03 +0000)]
Pass along LINKER_* vars during installworld and show in test-system-compiler.

Sponsored by: Dell EMC Isilon

7 years agoSupport cached linker values in environment.
bdrewery [Thu, 22 Jun 2017 21:03:27 +0000 (21:03 +0000)]
Support cached linker values in environment.

This is similar to r289659 for bsd.compiler.mk.

MFC after: 2 weeks
Reviewed by: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11310

7 years agoSupport XLD for setting X_LINKER_TYPE and X_LINKER_VERSION.
bdrewery [Thu, 22 Jun 2017 21:03:24 +0000 (21:03 +0000)]
Support XLD for setting X_LINKER_TYPE and X_LINKER_VERSION.

This is similar to r300350 for bsd.compiler.mk.

MFC after: 2 weeks
Reviewed by: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11309

7 years agoAdd basic bsd.linker.mk auto included from bsd.compiler.mk.
bdrewery [Thu, 22 Jun 2017 21:03:20 +0000 (21:03 +0000)]
Add basic bsd.linker.mk auto included from bsd.compiler.mk.

This will provide LINKER_TYPE and LINKER_VERSION.

MFC after: 2 weeks
Reviewed by: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11308

7 years agoFix spelling error.
bdrewery [Thu, 22 Jun 2017 20:32:23 +0000 (20:32 +0000)]
Fix spelling error.

Reported by: arc
Sponsored by: Dell EMC Isilon

7 years agoUpdate leap-seconds to leap-seconds.3701462400.
cy [Thu, 22 Jun 2017 19:25:17 +0000 (19:25 +0000)]
Update leap-seconds to leap-seconds.3701462400.

As per https://datacenter.iers.org/eop/-/somos/5Rgv/latest/16:

     INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)

SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE

SERVICE DE LA ROTATION TERRESTRE
OBSERVATOIRE DE PARIS
61, Av. de l'Observatoire 75014 PARIS (France)
Tel.      : 33 (0) 1 40 51 23 35
FAX       : 33 (0) 1 40 51 22 91
Internet  : services.iers@obspm.fr

                                             Paris, 9 January 2017

                                             Bulletin C 53

                                             To authorities responsible
                                             for the measurement and
                                             distribution of time

                          INFORMATION ON UTC - TAI

 NO leap second will be introduced at the end of June 2017.
 The difference between Coordinated Universal Time UTC and the
 International Atomic Time TAI is :

     from 2017 January 1, 0h UTC, until further notice : UTC-TAI = -37 s

 Leap seconds can be introduced in UTC at the end of the months of December
 or June,  depending on the evolution of UT1-TAI. Bulletin C is mailed every
 six months, either to announce a time step in UTC, or to confirm that there
 will be no time step at the next possible date.

                                            Christian BIZOUARD
                                            Director
                                            Earth Orientation Center of IERS
    Observatoire de Paris, France

Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3701462400
MFC after: 3 days

7 years agoUse __ISO_C_VISIBLE, as opposed to testing __STDC_VERSION__.
ed [Thu, 22 Jun 2017 18:39:52 +0000 (18:39 +0000)]
Use __ISO_C_VISIBLE, as opposed to testing __STDC_VERSION__.

FreeBSD's C library uses __STDC_VERSION__ to determine whether the
compiler provides language features specific to a certain version of the
C standard. __ISO_C_VISIBLE is used to specify which library features
need to be exposed.

max_align_t currently uses __STDC_VERSION__, even though it should be
using __ISO_C_VISIBLE to remain consistent with the rest of the headers
in include/.

Reviewed by: dim
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D11303

7 years agoMFV r319950: 5220 L2ARC does not support devices that do not provide 512B access
avg [Thu, 22 Jun 2017 17:10:34 +0000 (17:10 +0000)]
MFV r319950: 5220 L2ARC does not support devices that do not provide 512B access

FreeBSD note: the actual change has been in FreeBSD since r297848.  This
commit accounts for integration of that change with subsequent changes,
especially r320156 (MFV of r318946) and r314274.

illumos/illumos-gate@403a8da73c64ff9dfb6230ba045c765a242213fb
https://github.com/illumos/illumos-gate/commit/403a8da73c64ff9dfb6230ba045c765a242213fb

https://www.illumos.org/issues/5220
  There are disk devices that have logical sector size larger than 512B, for
  example 4KB. That is, their physical sector size is larger than 512B and they
  do not provide emulation for 512B sector sizes. For such devices both a data
  offset and a data size must be properly aligned. L2ARC should arrange that
  because it uses physical I/O.
  zio_vdev_io_start() performs a necessary transformation if io_size is not
  aligned to vdev_ashift, but that is done only for logical I/O. Something
  similar should be done in L2ARC code.
      * a temporary write buffer should be allocated if the original buffer is
        not going to be compressed and its size is not aligned
      * size of a temporary compression buffer should be ashift aligned
      * for the reads, if a size of a target buffer is not sufficiently large and
        it is not aligned then a temporary read buffer should be allocated

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>

MFC after: 3 weeks

7 years agoMFV r319742: 8056 zfs send size estimate is inaccurate for some zvols
avg [Thu, 22 Jun 2017 16:58:09 +0000 (16:58 +0000)]
MFV r319742: 8056 zfs send size estimate is inaccurate for some zvols

illumos/illumos-gate@0255edcc85fc0cd1dda0e49bcd52eb66c06a1b16
https://github.com/illumos/illumos-gate/commit/0255edcc85fc0cd1dda0e49bcd52eb66c06a1b16

https://www.illumos.org/issues/8056
  The send size estimate for a zvol can be too low, if the size of the record
  headers (dmu_replay_record_t's) is a significant portion of the size.
  This is typically the case when the data is highly compressible, especially
  with embedded blocks.
  The problem is that dmu_adjust_send_estimate_for_indirects() assumes that
  blocks are the size of the "recordsize" property (128KB).
  However, for zvols, the blocks are the size of the "volblocksize" property
  (8KB). Therefore, we estimate that there will be 16x less record headers than
  there really will be.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>

MFC after: 3 weeks

7 years agoMFV r318947: 7578 Fix/improve some aspects of ZIL writing.
avg [Thu, 22 Jun 2017 16:52:22 +0000 (16:52 +0000)]
MFV r318947: 7578 Fix/improve some aspects of ZIL writing.

FreeBSD note: this commit removes small differences between what mav
committed to FreeBSD in r308782 and what ended up committed to illumos
after addressing all review comments.

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

https://www.illumos.org/issues/7578
  After some ZIL changes 6 years ago zil_slog_limit got partially broken
  due to zl_itx_list_sz not updated when async itx'es upgraded to sync.
  Actually because of other changes about that time zl_itx_list_sz is not
  really required to implement the functionality, so this patch removes
  some unneeded broken code and variables.
  Original idea of zil_slog_limit was to reduce chance of SLOG abuse by
  single heavy logger, that increased latency for other (more latency critical)
  loggers, by pushing heavy log out into the main pool instead of SLOG. Beside
  huge latency increase for heavy writers, this implementation caused double
  write of all data, since the log records were explicitly prepared for SLOG.
  Since we now have I/O scheduler, I've found it can be much more efficient
  to reduce priority of heavy logger SLOG writes from ZIO_PRIORITY_SYNC_WRITE
  to ZIO_PRIORITY_ASYNC_WRITE, while still leave them on SLOG.
  Existing ZIL implementation had problem with space efficiency when it
  has to write large chunks of data into log blocks of limited size. In some
  cases efficiency stopped to almost as low as 50%. In case of ZIL stored on
  spinning rust, that also reduced log write speed in half, since head had to
  uselessly fly over allocated but not written areas. This change improves
  the situation by offloading problematic operations from z*_log_write() to
  zil_lwb_commit(), which knows real situation of log blocks allocation and
  can split large requests into pieces much more efficiently. Also as side
  effect it removes one of two data copy operations done by ZIL code WR_COPIED
  case.
  While there, untangle and unify code of z*_log_write() functions.
  Also zfs_log_write() alike to zvol_log_write() can now handle writes crossing
  block boundary, that may also improve efficiency if ZPL is made to do that.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Steven Hartland <steven.hartland@multiplay.co.uk>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Alexander Motin <mav@FreeBSD.org>

MFC after: 3 weeks

7 years agosglist.h: Fix sg_refs signedness to match refcount(9)
cem [Thu, 22 Jun 2017 15:52:18 +0000 (15:52 +0000)]
sglist.h: Fix sg_refs signedness to match refcount(9)

PR: 220122
Reported by: Mark Millard <markmi at dsl-only.net>
Sponsored by: Dell EMC Isilon

7 years agoretire arm64 kernel module linker workaround
emaste [Thu, 22 Jun 2017 15:09:42 +0000 (15:09 +0000)]
retire arm64 kernel module linker workaround

Relocatable linking in aarch64 ld from binutils 2.25.1 does not work.
The linker corrupts the references to the external symbols which are
defined by other object in the linking set and should therefore lose
the GOT entry.

The problem is fixed in later versions of GNU ld and does not exist in
the in-tree lld linker that we now use by default for arm64, so the
workaround can be removed.

Reviewed by: kib
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11302

7 years agoMake structure padding explicit in EFI_MEMORY_DESCRIPTOR
emaste [Thu, 22 Jun 2017 14:30:09 +0000 (14:30 +0000)]
Make structure padding explicit in EFI_MEMORY_DESCRIPTOR

The EFI memory descriptor 64-bit aligns PhysicalStart on both 32- and
64-bit platforms.  Make the padding explicit for i386 EFI.

Submitted by: Siva Mahadevan <smahadevan@freebsdfoundation.org>
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11301

7 years agoIn poolnodcommand(): TTL (-T) is only valid when adding a node to a
cy [Thu, 22 Jun 2017 12:46:48 +0000 (12:46 +0000)]
In poolnodcommand(): TTL (-T) is only valid when adding a node to a
pool (ippool -a) not when removing a node from a pool (ippool -r).
Flag -T as an error in ippool -r.

7 years agopoolflush() has no positional arguments.
cy [Thu, 22 Jun 2017 06:25:34 +0000 (06:25 +0000)]
poolflush() has no positional arguments.

7 years agoRework logic for skipping .depend/.meta file read/stat/writes.
bdrewery [Thu, 22 Jun 2017 05:34:41 +0000 (05:34 +0000)]
Rework logic for skipping .depend/.meta file read/stat/writes.

- Rename _SKIP_READ_DEPEND to _SKIP_DEPEND since it also avoids writing.
- This now uses .NOMETA to avoid reading any .meta files related to
  DEPENDOBJS.  Objects not in OBJS/DEPENDOBJS may still have their .meta
  files read in if they are in the dependency graph.
- This also avoids statting .meta and .depend files in the META_MODE +
  -DNO_FILEMON case.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoFix use-after-free introduced in r300388.
delphij [Thu, 22 Jun 2017 05:10:16 +0000 (05:10 +0000)]
Fix use-after-free introduced in r300388.

In r300388, endnetconfig() was called on nc_handle which would release
the associated netconfig structure, which means tmpnconf->nc_netid
would be a use-after-free.

Solve this by doing endnetconfig() in return paths instead.

Reported by: jemalloc via kevlo
Reviewed by: cem, ngie (earlier version)
MFC after: 3 days
Differential Revision:    https://reviews.freebsd.org/D11288

7 years agomakefs: add copies of NetBSD makefs msdos source files
emaste [Thu, 22 Jun 2017 02:46:36 +0000 (02:46 +0000)]
makefs: add copies of NetBSD makefs msdos source files

We do not treat makefs as contrib code.  Import copies of makefs msdos
files from NetBSD so that we can track our changes to these files.

These are copied from NetBSD, with only a change to use __FBSDID and
$FreeBSD$ instead of __KERNEL_RCSID and $NetBSD$.  A copy of the
original $NetBSD$ tag remains in each source file.

Submitted by: Siva Mahadevan
Sponsored by: The FreeBSD Foundation

7 years agoext2fs: add dir_nlink feature support.
pfg [Thu, 22 Jun 2017 02:43:32 +0000 (02:43 +0000)]
ext2fs: add dir_nlink feature support.

ext4 on linux has always supported more than 32000 directories through
the dir_nlink feature, but FreeBSD was unable to catch up on this feature.
As part of the 64 bit inode changes nlink_t has been extended and this
feature is now possible.

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

7 years agojoin(1): Fix field ordering for -v output
cem [Thu, 22 Jun 2017 02:19:39 +0000 (02:19 +0000)]
join(1): Fix field ordering for -v output

Per POSIX, join(1) (in modes other than -o) is a concatenation of selected
character fields.  The joined field is first, followed by fields in the
order they occurred in the input files.

Our join(1) utility previously handled this correctly for lines with a match
in the other file.  But it failed to order output fields correctly for
unmatched lines, printed in -a and -v modes.

A simple test case is:

$ touch a
$ echo "2 1" > b
$ join -v2 -2 2 a b
1 2

PR: 217711
Reported by: alt.j2-4o4s2yon at yopmail.com
Sponsored by: Dell EMC Isilon

7 years agomsdosfs: reformat a comment to reduce NetBSD diffs
emaste [Thu, 22 Jun 2017 01:11:20 +0000 (01:11 +0000)]
msdosfs: reformat a comment to reduce NetBSD diffs

7 years agoEnsure that the credentials field of the NFSv4 client open structure is
rmacklem [Thu, 22 Jun 2017 00:17:15 +0000 (00:17 +0000)]
Ensure that the credentials field of the NFSv4 client open structure is
initialized.

bdrewery@ has reported panics "newnfs_copycred: negative nfsc_ngroups".
The only way I can see that this occurs is that the credentials field of
the open structure gets used before being filled in.
I am not sure quite how this happens, but for the file create case, the
code is serialized via the vnode lock on the directory. If, somehow, a
link to the same file gets created just after file creation, this might
occur.

This patch ensures that the credentials field is initialized to a reasonable
set of credentials before the structure is linked into any list, so I
this should ensure it is initialized before use.
I am committing the patch now, since bdrewery@ notes that the panics
are intermittent and it may be months before he knows if the patch fixes
his problem.

Reported by: bdrewery
MFC after: 2 weeks

7 years agoTweak r320206: Still create the TABLE but not the .depend entry for missing headers.
bdrewery [Wed, 21 Jun 2017 23:28:24 +0000 (23:28 +0000)]
Tweak r320206: Still create the TABLE but not the .depend entry for missing headers.

X-MFC-With: r320206
MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoFollow-up r308602: Don't add missing headers to .depend.tables.h.
bdrewery [Wed, 21 Jun 2017 23:01:18 +0000 (23:01 +0000)]
Follow-up r308602: Don't add missing headers to .depend.tables.h.

This also avoids an error from egrep when a header is missing.  This can happen
with something like WITHOUT_BLUETOOTH set when searching for
$include_dir/netgraph/bluetooth/include/ng_btsocket.h.  The warning was
not an error (from set -e) due to being on the left side of a pipe.  Now the
all_headers list is only filled with existing headers.

Reviewed by: ngie
MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoRemove logic for setting .MAKE.DEPENDFILE=/dev/null already covered by _SKIP_BUILD.
bdrewery [Wed, 21 Jun 2017 20:10:58 +0000 (20:10 +0000)]
Remove logic for setting .MAKE.DEPENDFILE=/dev/null already covered by _SKIP_BUILD.

_SKIP_BUILD is defined in bsd.init.mk.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoFix various 'make *clean *all *install' combinations.
bdrewery [Wed, 21 Jun 2017 19:55:26 +0000 (19:55 +0000)]
Fix various 'make *clean *all *install' combinations.

This follows commits like r320174 in share/mk/bsd.dep.mk.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoSimilar to r296013 for NO_ROOT, force SUBDIR_PARALLEL for buildworld WORLDTMP staging.
bdrewery [Wed, 21 Jun 2017 18:56:53 +0000 (18:56 +0000)]
Similar to r296013 for NO_ROOT, force SUBDIR_PARALLEL for buildworld WORLDTMP staging.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoCall pmap_copy() only for map entries which have the backing object
kib [Wed, 21 Jun 2017 18:54:28 +0000 (18:54 +0000)]
Call pmap_copy() only for map entries which have the backing object
instantiated.

Calling pmap_copy() on non-faulted anonymous memory entries is useless.

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

7 years agoAssert that the protection of a new map entry is a subset of the max
kib [Wed, 21 Jun 2017 18:51:30 +0000 (18:51 +0000)]
Assert that the protection of a new map entry is a subset of the max
protection.

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

7 years agoEnable arm,io-coherent property of PL310 L2 cache on Armada 38x platforms
zbb [Wed, 21 Jun 2017 18:28:37 +0000 (18:28 +0000)]
Enable arm,io-coherent property of PL310 L2 cache on Armada 38x platforms

This patch disables outer cache sync in PL310 driver
by adding "arm,io-coherent" property. In addition to
the previous patches it was the last bit needed
for enabling proper operation of Armada 38x SoCs
with the IO cache coherency.

Submitted by: Michal Mazur <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: mmel
Differential revision: https://reviews.freebsd.org/D11204

7 years agoCreate root DMA tag and fix MBUS windows on DMA coherent platforms
zbb [Wed, 21 Jun 2017 18:27:05 +0000 (18:27 +0000)]
Create root DMA tag and fix MBUS windows on DMA coherent platforms

Armada 38x SoCs, in order to work properly in IO-coherent mode,
requires an update of the MBUS windows attributesd.

This patch also configures nexus coherent dma tag, because all
busses and children devices have to inherit this setting in runtime.
The latter has to be executed as a sysinit (SI_SUB_DRIVERS type),
so that bus_dma_tag_create() can be executed properly.

Submitted by: Michal Mazur <mkm@semihalf.com>
        Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: ian
Differential revision: https://reviews.freebsd.org/D11203

7 years agoEnable setting the dma tag at the nexus level
zbb [Wed, 21 Jun 2017 18:25:35 +0000 (18:25 +0000)]
Enable setting the dma tag at the nexus level

Allow to set the dma tag for nexus in the platform init code,
so that all busses and devices would be able to inherit it.
This change is useful e.g. for setting coherent dma tag for
the platforms with hardware IO cache coherency.

Submitted by: ian
             Michal Mazur <mkm@semihalf.com>
Reviewed by: ian
Differential revision: https://reviews.freebsd.org/D11202

7 years agoIntroduce support for DMA coherent ARM platforms
zbb [Wed, 21 Jun 2017 18:23:28 +0000 (18:23 +0000)]
Introduce support for DMA coherent ARM platforms

- Inherit BUS_DMA_COHERENT flag from parent buses
- Use cacheable memory attributes on dma coherent platform
- Disable cache synchronization on coherent platform

Changes are based on ARMv8 busdma code and commit r299683.

Submitted by: Michal Mazur <mkm@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: ian
Differential revision: https://reviews.freebsd.org/D11201

7 years agoUpdate io-mapping.h in the LinuxKPI.
markj [Wed, 21 Jun 2017 18:20:17 +0000 (18:20 +0000)]
Update io-mapping.h in the LinuxKPI.

Add io_mapping_init_wc() and add a third (unused) parameter to
io_mapping_map_wc().

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11286

7 years agobhyveload: correctly query size of disks
avg [Wed, 21 Jun 2017 18:19:27 +0000 (18:19 +0000)]
bhyveload: correctly query size of disks

On FreeBSD fstat(2) works fine for querying sizes of plain files,
but not so much for character devices.
So, use DIOCGMEDIASIZE to try to get the correct size for disks
and disk-like devices (e.g. zvols).

PR: 220186
Reviewed by: tsoome, grehan
MFC after: 1 week

7 years agoAdd missing lock destructor invocations to the LinuxKPI unload handler.
markj [Wed, 21 Jun 2017 18:17:32 +0000 (18:17 +0000)]
Add missing lock destructor invocations to the LinuxKPI unload handler.

MFC after: 1 week

7 years agoInclude kmod.h from the LinuxKPI's module.h.
markj [Wed, 21 Jun 2017 18:15:47 +0000 (18:15 +0000)]
Include kmod.h from the LinuxKPI's module.h.

MFC after: 1 week

7 years agoAdd a lockdep macro to the LinuxKPI.
markj [Wed, 21 Jun 2017 18:08:36 +0000 (18:08 +0000)]
Add a lockdep macro to the LinuxKPI.

Also fix some nearby style issues.

MFC after: 1 week

7 years agoobjwarn should be .PHONY.
bdrewery [Wed, 21 Jun 2017 17:11:49 +0000 (17:11 +0000)]
objwarn should be .PHONY.

Otherwise in META_MODE it may create an objwarn.meta if only bsd.obj.mk
is included;  bsd.sys.mk already had .PHONY: objwarn.

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agoAllow the VM fault handler to be NULL in the LinuxKPI when handling a
hselasky [Wed, 21 Jun 2017 14:38:52 +0000 (14:38 +0000)]
Allow the VM fault handler to be NULL in the LinuxKPI when handling a
memory map request. When the VM fault handler is NULL a return code of
VM_PAGER_BAD is returned from the character device's pager populate
handler. This fixes compatibility with Linux.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix -S handling within poolcommand(). Specifying a seed (-S) is only
cy [Wed, 21 Jun 2017 12:19:05 +0000 (12:19 +0000)]
Fix -S handling within poolcommand(). Specifying a seed (-S) is only
valid when adding a pool (ippool -A), not when removing a pool
(ippool -R). It is a command line syntax error if specifying a seed (-S)
is specified when emoving a pool (-R).

7 years agofix several fallouts from r320156, ZFS ABD import
avg [Wed, 21 Jun 2017 08:12:07 +0000 (08:12 +0000)]
fix several fallouts from r320156, ZFS ABD import

All of the problems were related to the FreeBSD-only features.
One was caused by a mismerge in the zfsbootcfg support code.
All others were in the TRIM support code.

MFC after: 1 week
X-MFC with: r320156

7 years agofix several fallouts from r320156, ZFS ABD import
avg [Wed, 21 Jun 2017 08:10:45 +0000 (08:10 +0000)]
fix several fallouts from r320156, ZFS ABD import

All of the problems were related to the FreeBSD-only features.
One was caused by a mismerge in the zfsbootcfg support code.
All others were in the TRIM support code.

Reported by: ken,
O. Hartmann <ohartmann@walstatt.org>,
Trond Endrestøl <Trond.Endrestol@fagskolen.gjovik.no>
MFC after: 1 week
X-MFC with: r320156

7 years agohyperv/storvsc: Reduce log verbosity
sephe [Wed, 21 Jun 2017 06:44:56 +0000 (06:44 +0000)]
hyperv/storvsc: Reduce log verbosity

On some windows hosts TEST_UNIT_READY command will return
SRB_STATUS_ERROR and sense data "NOT READY asc:3a,1 (Medium
not present - tray closed)", this occurs periodically, and
not hurt anything else.  So, we prefer to ignore this kind
of errors.

PR: 219973
Submitted by: Hongjiang Zhang <hongzhan microsoft com>
MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11271