]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoRFC: 312593, 313958
bapt [Sun, 2 Apr 2017 15:13:35 +0000 (15:13 +0000)]
RFC: 312593, 313958

Update mandoc to 1.14

7 years agoMFC: r315086 (by jhb)
bapt [Sun, 2 Apr 2017 15:04:26 +0000 (15:04 +0000)]
MFC: r315086 (by jhb)

Fix removal of /usr/share/info.

- The GNU as manual is named as.info.gz.
- Remove the generated /usr/share/info/dir file.

Reported by: "Herbert J. Skuhra" <herbert@mailbox.org>

7 years agoMFC r315709: Switch from using periph_links to sim_links.
mav [Sun, 2 Apr 2017 11:00:47 +0000 (11:00 +0000)]
MFC r315709: Switch from using periph_links to sim_links.

periph_links field belongs to periph drivers and must not be used here.

7 years agoMFC r315682, r315683: Remove some dead code left after r246713.
mav [Sun, 2 Apr 2017 10:58:55 +0000 (10:58 +0000)]
MFC r315682, r315683: Remove some dead code left after r246713.

7 years agoMFC r315681: Improve command timeout handling.
mav [Sun, 2 Apr 2017 10:57:19 +0000 (10:57 +0000)]
MFC r315681: Improve command timeout handling.

Let firmware do its best first, and if it can't, try software recovery.
I would remove software timeout handler completely, but found bunch of
complains on command timeout on sparc64 mailing list few years ago, so
better be safe in case of interrupt loss.

7 years agoMFC r315678: Remove questionable reqp->req_time access.
mav [Sun, 2 Apr 2017 10:55:40 +0000 (10:55 +0000)]
MFC r315678: Remove questionable reqp->req_time access.

7 years agoMFC r315677: Clean/unify some macro usage.
mav [Sun, 2 Apr 2017 10:54:28 +0000 (10:54 +0000)]
MFC r315677: Clean/unify some macro usage.

7 years agoMFC r315587, r315652: Remove some dead/useless code.
mav [Sun, 2 Apr 2017 10:53:03 +0000 (10:53 +0000)]
MFC r315587, r315652: Remove some dead/useless code.

7 years agoMFC r315579, r315670: Add initial support for multiple MSI-X vectors.
mav [Sun, 2 Apr 2017 10:50:49 +0000 (10:50 +0000)]
MFC r315579, r315670: Add initial support for multiple MSI-X vectors.

For 24xx and above use 2 vectors (default and response queue).
For 26xx and above use 3 vectors (default, response and ATIO queues).
Due to global lock interrupt hardlers never run simultaneously now, but
at least this allows to save one regitster read per interrupt.

7 years agoMFC r315968:
kib [Sun, 2 Apr 2017 07:11:15 +0000 (07:11 +0000)]
MFC r315968:
Provide less laborius way to enable busdma DMAR to only short list of devices.

7 years agoMFC r313483:
asomers [Sun, 2 Apr 2017 03:08:25 +0000 (03:08 +0000)]
MFC r313483:

Fix setting birthtime in ZFS

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
* In zfs_freebsd_setattr, if the caller wants to set the birthtime,
  set the bits that zfs_settattr expects

* In zfs_setattr, if XAT_CREATETIME is set, set xoa_createtime,
  expected by zfs_xvattr_set.  The two levels of indirection seem
  excessive, but it minimizes diffs vs OpenZFS.

* In zfs_setattr, check for overflow of va_birthtime (from delphij)

* Remove red herring in zfs_getattr

sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h
* Un-booby-trap some macros

New tests are under review at https://github.com/pjd/pjdfstest/pull/6

Reviewed by: avg
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9353

7 years agoMFC r314056:
asomers [Sun, 2 Apr 2017 03:00:50 +0000 (03:00 +0000)]
MFC r314056:

Improve pjdfstest run instructions

In the Kyua era, it's no longer necessary to set PJDFSTEST_TEST_PATH.  Just
use TMPDIR instead.

Reviewed by: ngie
MFC after: 3 weeks
Relnotes: yes
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9340

7 years agoMFC r315041
asomers [Sun, 2 Apr 2017 02:16:39 +0000 (02:16 +0000)]
MFC r315041

Increase WARNS for pw tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoMFC r315040
asomers [Sun, 2 Apr 2017 02:16:01 +0000 (02:16 +0000)]
MFC r315040

Increase WARNS for rtld-elf tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoMFC r315039
asomers [Sun, 2 Apr 2017 02:15:25 +0000 (02:15 +0000)]
MFC r315039

Increase WARNS for libutil tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoMFC r315038
asomers [Sun, 2 Apr 2017 02:14:44 +0000 (02:14 +0000)]
MFC r315038

Increase WARNS for libproc tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoMFC r315036
asomers [Sun, 2 Apr 2017 02:12:27 +0000 (02:12 +0000)]
MFC r315036

Increase WARNS for libmp tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoMFC r315035
asomers [Sun, 2 Apr 2017 02:11:53 +0000 (02:11 +0000)]
MFC r315035

Increase WARNS for libcrypt tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie, julian
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoMFC r315034
asomers [Sun, 2 Apr 2017 02:11:13 +0000 (02:11 +0000)]
MFC r315034

Document that the msun tests require WARNS=0

ATF tests have a default WARNS of 0, unlike other usermode programs.  This
change is technically a noop, but it documents that the msun tests don't
work with any warnings enabled, at least not on all architectures.

Reviewed by:  ngie
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoMFC r315033
asomers [Sun, 2 Apr 2017 02:10:19 +0000 (02:10 +0000)]
MFC r315033

Increase WARNS for nss tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by:  ngie
MFC after:    3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision:        https://reviews.freebsd.org/D9933

7 years agoMFC r315032
asomers [Sun, 2 Apr 2017 02:09:39 +0000 (02:09 +0000)]
MFC r315032

Increase WARNS for iconv tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by: ngie
MFC after: 3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision: https://reviews.freebsd.org/D9933

7 years agoMFC r314963:
asomers [Sat, 1 Apr 2017 21:53:58 +0000 (21:53 +0000)]
MFC r314963:

Fix harmless mismerge from r286964

MFC after: 3 days
Sponsored by: Spectra Logic Corp

7 years agoMFC r314947:
asomers [Sat, 1 Apr 2017 21:06:22 +0000 (21:06 +0000)]
MFC r314947:

Slight rewording in nvme(4)

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

7 years agoMFC r314341:
asomers [Sat, 1 Apr 2017 20:51:22 +0000 (20:51 +0000)]
MFC r314341:

Update devd.conf for ports change 421360

Ports change 421360 changed the name and UID of the postgres user

Reviewed by: trasz, imp, girgen
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9746

7 years agoMFC r310146,r311912,r312369,r312617,r312614,r312659,r312974,r312977,r313005,r314826:
jhibbits [Sat, 1 Apr 2017 19:27:06 +0000 (19:27 +0000)]
MFC r310146,r311912,r312369,r312617,r312614,r312659,r312974,r312977,r313005,r314826:

  A series of Clang-related powerpc commits

  r310146:
    Use the right bitwise OR operation for clearing single-step at trap time.
  r311912:
    Force all TOC references in asm to include '@toc'
  r312369:
    Use the explicit expanded form of cmp.
  r312617:
    Hide the 'MOREARGS' macro, it conflicts with contrib code, and is only used
    in one file.
  r312614:
    Don't pass -Wa,-many through clang, the integrated as doesn't support it.
  r312659:
    Avoid using non-zero argument for __builtin_frame_address().
  r312974:
    Add a INTR_TRIG_INVALID, and use it in the powerpc interrupt code.
  r312977:
    Force the setting of bit 7 in the sysmouse packet byte 1 to be unsigned.
  r313005:
    Update CFLAGS for clang compatibility
  r314826:
    Clang in base now supports -mlongcall, so remove this hack

7 years agoMFC r314885:
jhibbits [Sat, 1 Apr 2017 18:52:48 +0000 (18:52 +0000)]
MFC r314885:

  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

7 years agoMFC r313994:
trasz [Sat, 1 Apr 2017 17:15:53 +0000 (17:15 +0000)]
MFC r313994:

Simplify devfs_fsync() by removing it. This might also be a minor
optimization, as vn_isdisk() needs to lock a global mutex.

Sponsored by: DARPA, AFRL

7 years agoMFC r313994:
trasz [Sat, 1 Apr 2017 17:13:00 +0000 (17:13 +0000)]
MFC r313994:

Change the "devfs_fsync: vop_stdfsync failed" from panic to a printf.
It's not a proper fix, but should be better than what we have now.
Since it got broken some six months ago it results in an incredibly
annoying and trivially reproducible panic every time eg an USB disk
gets disconnected.

Sponsored by: DARPA, AFRL

7 years agoMFC r314046:
trasz [Sat, 1 Apr 2017 17:09:55 +0000 (17:09 +0000)]
MFC r314046:

Get rid of foo_sys() in linuxulator code.  It was commented out, and it
would be useless anyway - there is no point in pretending to have block
devices; our "block" devices are in fact character ones, and can only
be accessed as such.

Sponsored by: DARPA, AFRL

7 years agoMFC r313769:
trasz [Sat, 1 Apr 2017 17:07:09 +0000 (17:07 +0000)]
MFC r313769:

Fix definition of linux64 ptrace syscall.

Relnotes: yes
Sponsored by: DARPA, AFRL

7 years agoMFC r314148, r314150
asomers [Sat, 1 Apr 2017 16:51:49 +0000 (16:51 +0000)]
MFC r314148, r314150

r314148:
Misc Coverity fixes in xnb(4)

Most of these are null pointer dereferences or missing error checks in the
unit tests. One is a missing error check in xnb_attach_failed. None can
cause real problems in running systems.

Reported by: Coverity
CIDs: 1092469 1092468 1092467 2092466 1092465 1092512 1092511 1092510
CIDs: 1092510 1092509 1092508 1092507
Reviewed by: royger
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9234

r314150:
Fix the xnb(4) unit tests

One test was inadvertently expecting a bug in the kernel's sscanf
implementation circa 2012. I don't know when that bug got fixed.

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

7 years agoMFC r313770:
trasz [Sat, 1 Apr 2017 16:38:20 +0000 (16:38 +0000)]
MFC r313770:

Regen after r313769.

Sponsored by: DARPA, AFRL

7 years agoMFC r313769:
trasz [Sat, 1 Apr 2017 16:35:42 +0000 (16:35 +0000)]
MFC r313769:

Fix definition of linux64 ptrace syscall.

Sponsored by: DARPA, AFRL

7 years agoMFC r313069:
asomers [Sat, 1 Apr 2017 16:22:07 +0000 (16:22 +0000)]
MFC r313069:

Allow 999.local to run scripts in any language

If one of the scripts listed in (daily|weekly|monthly)_local is executable,
999.local should simply execute it. Only if the script isn't executable
should 999.local assume it needs /bin/sh.

Reviewed by: brian
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

7 years agoMFC r315947:
dim [Sat, 1 Apr 2017 11:24:34 +0000 (11:24 +0000)]
MFC r315947:

Import libcxxrt master 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92.

Interesting fixes which were not already merged:
0c7c611 Merge C++ demangler bug fixes from ELF Tool Chain (#40)
2b208d9 __cxa_demangle_gnu3: demangle 'z' as '...', not 'ellipsis' (#41)

7 years agoMFC r316133:
ae [Sat, 1 Apr 2017 10:02:36 +0000 (10:02 +0000)]
MFC r316133:
  Fix bug in r308972 that leads to panic when non-compressed IPComp
  packet is received.

  Reported by: Denis Ahrens <denis h3q com>

7 years agoMFC r316061:
bapt [Sat, 1 Apr 2017 09:33:22 +0000 (09:33 +0000)]
MFC r316061:

Update pci_vendors to 2017-03-16

7 years agoMFC r316060:
bapt [Sat, 1 Apr 2017 09:31:20 +0000 (09:31 +0000)]
MFC r316060:

Import tzdata 2017b

7 years agoMFC: r315912 (by eugen@) and r315935
bapt [Sat, 1 Apr 2017 09:27:00 +0000 (09:27 +0000)]
MFC: r315912 (by eugen@) and r315935

Properly initialise with content of pw.conf(5) that was mistakenly ignored.
Also, respect "defaultgroup" if specified there.

Add a regression test

PR: 217934
Reported by: Victor Sudakov <vas@mpeks.tomsk.su>

7 years agoMFC r315934:
kib [Sat, 1 Apr 2017 08:40:47 +0000 (08:40 +0000)]
MFC r315934:
Avoid leaking allocated but unused context after creation race.

7 years agoMFC r315933:
kib [Sat, 1 Apr 2017 08:37:19 +0000 (08:37 +0000)]
MFC r315933:
Do not create RMRR entries for identity-mapped domains.

7 years agoMFC r315932:
kib [Sat, 1 Apr 2017 08:34:53 +0000 (08:34 +0000)]
MFC r315932:
Slight cleanup of the comment.

7 years agoMFC r315636,315876,316095:
mm [Fri, 31 Mar 2017 20:16:24 +0000 (20:16 +0000)]
MFC r315636,315876,316095:
Sync libarchive with vendor

Vendor changes/bugfixes (FreeBSD-related):
r315636:
  PR 867 (bsdcpio): show numeric uid/gid when names are not found
  PR 870 (seekable zip): accept files with valid ZIP64 EOCD headers
  PR 880 (pax): Fix handling of "size" pax header keyword
  PR 887 (crypto): Discard 3072 bytes instead of 1024 of first keystream
  OSS-Fuzz issue 806 (mtree): rework mtree_atol10 integer parser
  Break ACL read/write code into platform-specific source files

r315876:
  Store extended attributes with extattr_set_link() if no fd is provided
  Add extended attribute tests to libarchive and bsdtar
  Fix tar's test_option_acls
  Support the UF_HIDDEN file flag

r316095:
  Constify variables in several places
  Unify platform ACL code in a single source file
  Fix unused variable if compiling on FreeBSD without NFSv4 ACL support

7 years agoMFC r309551:
kib [Fri, 31 Mar 2017 15:46:47 +0000 (15:46 +0000)]
MFC r309551:
Release DMAR table after using it.

7 years agoMFC r315402:
royger [Fri, 31 Mar 2017 10:26:14 +0000 (10:26 +0000)]
MFC r315402:

x86/srat: fix parsing of APIC IDs > MAX_APIC_ID

7 years agoMFC r315892:
ed [Fri, 31 Mar 2017 08:43:07 +0000 (08:43 +0000)]
MFC r315892:

  Include <sys/systm.h> to obtain the memcpy() prototype.

  I got a report of this source file not building on Raspberry Pi. It's
  interesting that this only fails for that target and not for others.
  Again, that's no reason not to include the right headers.

PR:           217969
Reported by:  Johannes Jost Meixner

7 years agoMFC r315516
truckman [Fri, 31 Mar 2017 06:20:06 +0000 (06:20 +0000)]
MFC r315516

Change several constants used by the PIE algorithm from unsigned to signed.

 - PIE_MAX_PROB is compared to variable of int64_t and the type promotion
   rules can cause the value of that variable to be treated as unsigned.
   If the value is actually negative, then the result of the comparsion
   is incorrect, causing the algorithm to perform poorly in some
   situations.  Changing the constant to be signed cause the comparision
   to work correctly.

 - PIE_SCALE is also compared to signed values.  Fortunately they are
   also compared to zero and negative values are discarded so this is
   more of a cosmetic fix.

 - PIE_DQ_THRESHOLD is only compared to unsigned values, but it is small
   enough that the automatic promotion to unsigned is harmless.

Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>

7 years agoMFC r316106:
ngie [Fri, 31 Mar 2017 04:51:03 +0000 (04:51 +0000)]
MFC r316106:

Don't shadow read(2) definition with `read` argument in vdev_{create,probe}

This fixes several -Wshadow warnings introduced in r192194, but now errors
with gcc 6.3.0.

7 years agoMFC r316107:
ngie [Fri, 31 Mar 2017 04:44:35 +0000 (04:44 +0000)]
MFC r316107:

Remove redundant declaration for `zfs_crc64_table`

zfssubr.c already defines this statically. Besides, zfsimpl.c defined it, but
didn't use it.

This fixes a -Wredundant-decls warning.

7 years agoMFC r316108:
ngie [Fri, 31 Mar 2017 04:43:21 +0000 (04:43 +0000)]
MFC r316108:

Remove -Wunused-but-set variable, `tail` in `ls_getdir(..)`

This variable has been unused since its inception in r40106.

7 years agoMFC r316080,r316081,r316115:
ngie [Fri, 31 Mar 2017 04:42:11 +0000 (04:42 +0000)]
MFC r316080,r316081,r316115:

r316080:

Fix some localized style(9) issues and reword CAM_ERRBUF_SIZE description

The CAM_ERRBUF_SIZE description rewording fixes a typo by proxy.

r316081:

Use `sizeof(cam_errbuf)` instead of `CAM_ERRBUF_SIZE` in snprintf calls

Reindent snprintf calls' arguments to match style(9) guidelines with
respect to indentation.

r316115:

libcam: use __func__ instead of hardcoding the function name as `func_name`

Tested with: `cam_device_copy(NULL, NULL)` // ;)..

7 years agoMFC: r306686, r308953, r311462, r311529, r312438, r314611
jkim [Thu, 30 Mar 2017 20:18:34 +0000 (20:18 +0000)]
MFC: r306686, r308953, r311462, r311529, r312438, r314611

- Merge ACPICA 20170303.
- Remove '-vd' option to make iasl(8) reproducible.

Relnotes: yes

7 years agoMFC r314404:
dchagin [Thu, 30 Mar 2017 20:14:43 +0000 (20:14 +0000)]
MFC r314404:

Linux epoll return EEXIST on case when op is EPOLL_CTL_ADD, and the supplied
file descriptor fd is already registered with this epoll instance.

7 years agoMFC r314403:
dchagin [Thu, 30 Mar 2017 20:13:47 +0000 (20:13 +0000)]
MFC r314403:

Linux epoll return ENOENT error in case when op is EPOLL_CTL_MOD or
EPOLL_CTL_DEL, and fd is not registered with this epoll instance.

7 years agoMFC r314402:
dchagin [Thu, 30 Mar 2017 20:12:23 +0000 (20:12 +0000)]
MFC r314402:

FreeBSD does not have analgue for epoll EPOLLPRI event type.
So, do not set EPOLLPRI event acidently.
Also, do not set EPOLLWRNORM and EPOLLRDNORM events as epoll
do not set this events.

7 years agoMFC r314344:
dchagin [Thu, 30 Mar 2017 20:10:57 +0000 (20:10 +0000)]
MFC r314344:

Return EINVAL when an invalid file descriptor specified.

7 years agoMFC r314343:
dchagin [Thu, 30 Mar 2017 20:09:49 +0000 (20:09 +0000)]
MFC r314343:

Unify eventfd ioctl method and use it for other similar interfaces.

7 years agoMFC r314312:
dchagin [Thu, 30 Mar 2017 20:08:25 +0000 (20:08 +0000)]
MFC r314312:

Change Linux epoll_pwait syscall definition to match Linux actual one.

MFC r314313:

Regen for r314312 (Linux epoll_pwait).

MFC r314314:

Return EINVAL in case when an invalid size of signal mask specified.

7 years agoMFC r314311:
dchagin [Thu, 30 Mar 2017 20:05:16 +0000 (20:05 +0000)]
MFC r314311:

Restore signal mask in epoll_pwait.

7 years agoMFC r314309:
dchagin [Thu, 30 Mar 2017 20:04:28 +0000 (20:04 +0000)]
MFC r314309:

Return EINVAL when an invalid file descriptor is specified.

7 years agoMFC r314295:
dchagin [Thu, 30 Mar 2017 20:03:20 +0000 (20:03 +0000)]
MFC r314295:

Implement timerfd family syscalls.

7 years agoMFC r314294:
dchagin [Thu, 30 Mar 2017 20:02:19 +0000 (20:02 +0000)]
MFC r314294:

Mostly style(9) changes, replace unused eventfd_truncate()
by default invfo_truncate() method.

7 years agoMFC r314293:
dchagin [Thu, 30 Mar 2017 20:00:57 +0000 (20:00 +0000)]
MFC r314293:

Return EOVERFLOW error in case then the size of tv_sec field of struct timespec
in COMPAT_LINUX32 Linuxulator's not equal to the size of native tv_sec.

7 years agoMFC r314292:
dchagin [Thu, 30 Mar 2017 19:59:23 +0000 (19:59 +0000)]
MFC r314292:

Regen after r314291 (timerfd definition).

7 years agoMFC r314291:
dchagin [Thu, 30 Mar 2017 19:56:41 +0000 (19:56 +0000)]
MFC r314291:

Change Linuxulator timerfd syscalls definition to match actual Linux one.

7 years agoboot1.efi: can't boot from ZFS on 4kn HDD
tsoome [Thu, 30 Mar 2017 17:23:40 +0000 (17:23 +0000)]
boot1.efi: can't boot from ZFS on 4kn HDD

The boot1.efi immediate issue from PR216964 is that we are reading into
too small buffer, from UEFI spec 2.6:

The size of the Buffer in bytes. This must be a multiple of the intrinsic block size of the device.

The secondary issue is that LBA calculation does not check reminder from
division.

This fix does check the provided buffer size and if we read less than
media sector size or the read offset is not aligned to sector boundary,
we allocate bounce buffer and perform the read by single sector.

PR: 216964
Reported by: Sergey Kozlov
Reviewed by: allanjude, Sergey Kozlov
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D9870

7 years agoMFC r315732:
ed [Thu, 30 Mar 2017 15:05:49 +0000 (15:05 +0000)]
MFC r315732:

  Add forward declaration for struct vnode.

  The coredump() function provided by this header file has struct vnode *
  as an argument.

7 years agoMFC r303018:
ae [Thu, 30 Mar 2017 14:20:27 +0000 (14:20 +0000)]
MFC r303018:
  Add named dynamic states support to ipfw(4).

  The keep-state, limit and check-state now will have additional argument
  flowname. This flowname will be assigned to dynamic rule by keep-state
  or limit opcode. And then can be matched by check-state opcode or
  O_PROBE_STATE internal opcode. To reduce possible breakage and to maximize
  compatibility with old rulesets default flowname introduced.
  It will be assigned to the rules when user has omitted state name in
  keep-state and check-state opcodes. Also if name is ambiguous (can be
  evaluated as rule opcode) it will be replaced to default.

  Reviewed by: julian
  Obtained from: Yandex LLC
  Relnotes: yes
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D6674

MFC r304087:
  Do not warn about ambiguous state name when we inspect a comment token.

MFC r304089:
  Add an ability to attach comment to check-state rules.

MFC r310727 (by marius):
  Fix a bug in r272840; given that the optlen parameter of setsockopt(2)
  is a 32-bit socklen_t, do_get3() passes the kernel to access the wrong
  32-bit half on big-endian LP64 machines when simply casting the 64-bit
  size_t optlen to a socklen_t pointer.
  While at it and given that the intention of do_get3() apparently is to
  hide/wrap the fact that socket options are used for communication with
  ipfw(4), change the optlen parameter of do_set3() to be of type size_t
  and as such more appropriate than uintptr_t, too.

MFC r315305:
  Change the syntax of ipfw's named states.

  Since the state name is an optional argument, it often can conflict
  with other options. To avoid ambiguity now the state name must be
  prefixed with a colon.

Sponsored by: Yandex LLC

7 years agoMFC: 314547, 314770, 314828, 314891, 314956, 314962, 315235
dexuan [Thu, 30 Mar 2017 12:41:21 +0000 (12:41 +0000)]
MFC: 314547, 314770, 314828, 314891, 314956, 314962, 315235

r314547
    loader.efi: reduce the size of the staging area if necessary

    The loader assumes physical memory in [2MB, 2MB + EFI_STAGING_SIZE)
    is Conventional Memory, but actually it may not, e.g. in the case
    of Hyper-V Generation-2 VM (i.e. UEFI VM) running on Windows
    Server 2012 R2 host, there is a BootServiceData memory block at
    the address 47.449MB and the memory is not writable.

    Without the patch, the loader will crash in efi_copy_finish():
    see PR 211746.

    The patch verifies the end of the staging area, and reduces its
    size if necessary. This way, the loader will not try to write into
    the BootServiceData memory any longer.

    Thank Marcel Moolenaar for helping me on this issue!

    The patch also allocates the staging area in the first 1GB memory.
    See the comment in the patch for this.

    PR: 211746
    Reviewed by: marcel, kib, sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D9686

r314770
    loader.efi: fix recent UEFI-boot regression on physical machines

    This patch fixes my recent patch
    "loader.efi: reduce the size of the staging area if necessary", which
    causes EFI-boot failure on physical machines since Mar 2:
    on the host there is a 1MB LoaderData memory range, which splits
    the big Conventional Memory range into a small one (15MB) and a
    big one: the small one is too small to hold the staging area.

    We can actually use the LoaderData range safely, because when
    amd64_tramp -> efi_copy_finish() starts to run, we're almost at
    the very end of the efi loader code and we're going to "return"
    to the kernel entry, so we're pretty sure we won't access any loader
    data any more.

    For people who are interested in the details: please see
    https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746#c22

    PS, some people also reported the regression happened to FreeBSD VM
    running on Bhyve in EFI mode. This patch should resolve it too,
    though I don't have such a setup to test.

    Reviewed by: sephe
    Approved by: sephe (mentor)
    Sponsored by: Microsoft
    Differential Revision: https://reviews.freebsd.org/D9904

r314828
    loader.efi: fix an off-by-one bug in efi_verify_staging_size()

    Also remove the warning message: it may not be unusual to see
    the memory range containing 2MB is not of EfiConventionalMemory.

    Sponsored by: Microsoft

r314891
    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...

    Sponsored by: Microsoft

r314956
    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...

    Sponsored by: Microsoft

r314962
    loader.efi: only include the machine/ header files on x86

    The 2 files may not exist on other archs like aarch64 and hence we
    can have a build failure there.

    Reported by: lwhsu
    Sponsored by: Microsoft

r315235
    loader.efi: use stricter check for Hyper-V

    Some other hypervisors like Xen can pretend to be Hyper-V but obviously
    they can't implement all Hyper-V features. Let's make sure we're genuine
    Hyper-V here.

    Also fix some minor coding style issues.

    PR: 211746
    Sponsored by: Microsoft

PR: 211746

7 years agoMFC r315776:
ngie [Thu, 30 Mar 2017 06:20:24 +0000 (06:20 +0000)]
MFC r315776:

Rename tests from <foo> to <foo>_test to match the FreeBSD test suite
naming scheme

usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test
to avoid collisions with the renamed FreeBSD test.

7 years agoMFC r315798:
ngie [Thu, 30 Mar 2017 06:14:32 +0000 (06:14 +0000)]
MFC r315798:

DB_COMMAND(9): fix mandoc markup

Start new sentences on new lines.

7 years agoMFC r316050,r316051:
ngie [Thu, 30 Mar 2017 06:13:39 +0000 (06:13 +0000)]
MFC r316050,r316051:

r316050:

ctld: sort #includes per style(9)

- Only include sys/types.h or sys/param.h, not both.
- Sort alphabetically.

r316051:

ctldadm: sort #includes per style(9)

- Only include sys/types.h or sys/param.h, not both.
- Sort alphabetically.

7 years agoRegenerate src.conf(5)
ngie [Thu, 30 Mar 2017 06:11:56 +0000 (06:11 +0000)]
Regenerate src.conf(5)

Differential Revision: Dell EMC Isilon

7 years agoMFC r315764,r315765:
ngie [Thu, 30 Mar 2017 06:09:39 +0000 (06:09 +0000)]
MFC r315764,r315765:

r315764:

Add a WITHOUT_IPSEC_SUPPORT option description for src.conf(5)

This is a follow up commit to r313330.

r315765:

Fix mdoc(7) warning: new sentences should start on new lines

7 years agoMFC r315762:
ngie [Thu, 30 Mar 2017 06:07:36 +0000 (06:07 +0000)]
MFC r315762:

rc.conf(5): fix a .Xr call for chroot(8)

Add the missing section number to the .Xr call.

7 years agoMFC r315795:
ngie [Thu, 30 Mar 2017 06:06:47 +0000 (06:06 +0000)]
MFC r315795:

alq(9): fix mandoc markup

Start new sentence on a new line.

7 years agoMFC r315803:
ngie [Thu, 30 Mar 2017 06:05:30 +0000 (06:05 +0000)]
MFC r315803:

memguard(9): fix igor/manlint warnings

- Expand a contraction [1].
- Add a missing section number when referring to uma(9) with .Xr .

7 years agoMFC r315790:
ngie [Thu, 30 Mar 2017 06:04:13 +0000 (06:04 +0000)]
MFC r315790:

tuning(7): fix SEE ALSO section sorting

dummynet(4) should come before eventtimers(4)

7 years agoMFC r315788:
ngie [Thu, 30 Mar 2017 06:02:48 +0000 (06:02 +0000)]
MFC r315788:

build(7): sort SEE ALSO section

tests(7) should be grouped in the man section 7 group, not the section 8 group.

7 years agoMFC r315802:
ngie [Thu, 30 Mar 2017 06:00:36 +0000 (06:00 +0000)]
MFC r315802:

ifnet(9): fix some igor/manlint warnings

- Fix typos (queueing -> queuing) [1].
- Add missing section number for polling .Xr reference [2].

7 years agoMFC r315804:
ngie [Thu, 30 Mar 2017 05:58:31 +0000 (05:58 +0000)]
MFC r315804:

PCI_IOV_*INIT(9): fix make manlint warnings

Add missing section number when referring to PCI_IOV_*INIT(9) with .Xr
from the other corresponding manpage.

7 years agoMFC r315772:
ngie [Thu, 30 Mar 2017 05:54:22 +0000 (05:54 +0000)]
MFC r315772:

tmpfs(5): fix mdoc warnings

- Delete trailing whitespace
- Sort SEE ALSO order: mmap(2)'s Xr should come before nmount(2)'s Xr.

7 years agoMFC r315789:
ngie [Thu, 30 Mar 2017 05:50:36 +0000 (05:50 +0000)]
MFC r315789:

tests(7): fix mdoc warning

Continue sentence in "Configuring the tests" on a new line.

7 years agoMFC r316049:
ngie [Thu, 30 Mar 2017 05:49:23 +0000 (05:49 +0000)]
MFC r316049:

Allow WARNS to be overridden by the end-user

7 years agoBackport mlx4{en,ib}(4) from ^/head
ngie [Thu, 30 Mar 2017 05:47:18 +0000 (05:47 +0000)]
Backport mlx4{en,ib}(4) from ^/head

MFCing other pieces would be very structurally disruptive. This just
brings back the manpages so they can be used by end-users and to ease
future backports.

svn:mergeinfo omitted, in part because this is a direct commit to
^/stable/11.

Sponsored by: Dell EMC Isilon

7 years agoRevert r316226 (I used the wrong commit message)
ngie [Thu, 30 Mar 2017 05:44:54 +0000 (05:44 +0000)]
Revert r316226 (I used the wrong commit message)

Pointyhat to: ngie

7 years agoMFC r315797:
ngie [Thu, 30 Mar 2017 05:43:18 +0000 (05:43 +0000)]
MFC r315797:

buf_ring(9): fix mandoc markup

Remove spurious trailing comma after `buf_ring_peek` in the NAME
section.

7 years agoMFC r315759,r315761:
ngie [Thu, 30 Mar 2017 05:41:27 +0000 (05:41 +0000)]
MFC r315759,r315761:

r315759 (by gjb):

Add mlx5en(4) to the hardware page. [1]
Belatedly bump copyright years after several changes.

r315761:

Add cxgbe(4), ixl(4), and mlx4en(4) to the hardware release notes

7 years agoMFC r315759,r315761:
ngie [Thu, 30 Mar 2017 05:22:02 +0000 (05:22 +0000)]
MFC r315759,r315761:

r315759 (by gjb):

Add mlx5en(4) to the hardware page. [1]
Belatedly bump copyright years after several changes.

r315761:

Add cxgbe(4), ixl(4), and mlx4en(4) to the hardware release notes

7 years agoMFC r316053:
ngie [Thu, 30 Mar 2017 05:18:28 +0000 (05:18 +0000)]
MFC r316053:

pthread_mutex_consistent: sort SEE ALSO by reference name

7 years agoMFC r315774:
ngie [Thu, 30 Mar 2017 05:17:27 +0000 (05:17 +0000)]
MFC r315774:

mount.conf(8): fix a .Xr call

Add the missing section number for devfs(5)

7 years agoMFC r315796:
ngie [Thu, 30 Mar 2017 05:16:41 +0000 (05:16 +0000)]
MFC r315796:

bus_alloc_resource(9): fix mandoc markup

Add missing comma after `.Nm bus_alloc_resource_any` in NAME section.

7 years agoMFC r314372:
ngie [Thu, 30 Mar 2017 05:14:52 +0000 (05:14 +0000)]
MFC r314372:

Use "build" instead of "all" when building ports modules

"all" in ports currently means "stage the ports", which requires root today,
and brings to light other potential issues, like ENAMETOOLONG with staged
directories (bug 161481, etc).

This fixes buildkernel for me when run as a non-root user, assuming all
of the prerequisites have been installed beforehand and are up-to-date.

Discussed with: swills (IRC)

7 years agoMFC r315734:
ngie [Thu, 30 Mar 2017 05:13:47 +0000 (05:13 +0000)]
MFC r315734:

style(9): sort #includes

7 years agoMFC: 313176, 313177, 313359
gnn [Thu, 30 Mar 2017 02:50:21 +0000 (02:50 +0000)]
MFC: 313176, 313177, 313359

Replace the implementation of DTrace's RAND subroutine for generating
low-quality random numbers with a modern implementation (xoroshiro128+)
that is capable of generating better quality randomness without compromising performance.

Submitted by: Graeme Jenkinson

7 years agoMFC: 311225, 311243, 313045
gnn [Thu, 30 Mar 2017 02:38:30 +0000 (02:38 +0000)]
MFC: 311225, 311243, 313045

Fix DTrace TCP tracepoints to not use mtod() as it is both unnecessary and
dangerous.  Those wanting data from an mbuf should use DTrace itself to get
the data.

Add an mbuf to ipinfo_t translator to finish cleanup of mbuf passing to TCP probes.

7 years agoMFC r309192
sevan [Thu, 30 Mar 2017 02:03:34 +0000 (02:03 +0000)]
MFC r309192

Fix null dereference when running out of nodes during rename.

PR:             212370
Submitted by:   Sascha Wildner <swildner AT gmail>
Reviewed by:    bcr (mentor)
Approved by:    bapt
Obtained from:  NetBSD
Differential Revision:  https://reviews.freebsd.org/D8643

7 years agoMFC r312692
sevan [Thu, 30 Mar 2017 01:52:02 +0000 (01:52 +0000)]
MFC r312692

Improve wording when describing -mmin.
PR: 215922
Submitted by: danielsh AT apache DOT org
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D9313

7 years agoMFC r316022,r316023:
jamie [Thu, 30 Mar 2017 01:37:34 +0000 (01:37 +0000)]
MFC r316022,r316023:

  Fix hexadecimal escape codes in jail.conf(5).

PR: 218154
Submitted by: Masahiro Konishi <mkonishi@sea.plala.or.jp>

7 years agoMFC 309552
sevan [Thu, 30 Mar 2017 01:30:27 +0000 (01:30 +0000)]
MFC 309552

Adjust formatting highlighted by igor.

PR: 214683
Submitted by: Anindya Mukherjee <anindya49 AT hotmail DOT com>
Reviewed by: jilles
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D8591