]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFV r311899:
mm [Tue, 10 Jan 2017 21:59:35 +0000 (21:59 +0000)]
MFV r311899:

Sync libarchive with vendor.

Vendor bugfixes:
#691: Support for SCHILY.xattr extended attributes
#854: Spelling fixes

Multiple fixes in ACL code:
  - prefer acl_set_fd_np() to acl_set_fd()
  - if acl_set_fd_np() fails, do no fallback to acl_set_file()
  - do not warn if trying to write ACLs to a filesystem without ACL support
  - fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs

MFC after: 1 week
X-MFC with: r310866

7 years agoCoalesce TLB shootdowns of global PTEs in pmap_advise() on x86.
markj [Tue, 10 Jan 2017 21:52:48 +0000 (21:52 +0000)]
Coalesce TLB shootdowns of global PTEs in pmap_advise() on x86.

We would previously invalidate such entries individually, resulting in more
IPIs than necessary.

Reviewed by: alc, kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D9094

7 years agoDo not set BIO_DONE if the BIO specifies a completion handler.
markj [Tue, 10 Jan 2017 21:41:28 +0000 (21:41 +0000)]
Do not set BIO_DONE if the BIO specifies a completion handler.

biowait() will otherwise race with completions of such BIOs. In-tree code
only calls biowait() on BIOs that do not specify a handler, so this change
should not have any functional impact.

Reviewed by: mav
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9070

7 years agoSet CFLAGS correctly for sys/modules/em
sbruno [Tue, 10 Jan 2017 21:21:00 +0000 (21:21 +0000)]
Set CFLAGS correctly for sys/modules/em

Unbreak gcc sparc64 builds (or any gcc build that uses em(4)).

Reported by: lidl@freebsd.org

7 years agoUpdate vendor/libarchive to git 22f2d190639e6bd496a3b82f70c01fba0d38b40a
mm [Tue, 10 Jan 2017 21:18:32 +0000 (21:18 +0000)]
Update vendor/libarchive to git 22f2d190639e6bd496a3b82f70c01fba0d38b40a

Vendor changes:
#691: Support for SCHILY.xattr extended attributes
#854: Spelling fixes

Multiple fixes in ACL code:
  - prefer acl_set_fd_np() to acl_set_fd()
  - if acl_set_fd_np() fails, do no fallback to acl_set_file()
  - do not warn if trying to write ACLs to a filesystem without ACL support
  - fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs

7 years agosparc64: add atomic_fcmpset
mjg [Tue, 10 Jan 2017 21:10:20 +0000 (21:10 +0000)]
sparc64: add atomic_fcmpset

Tested on hardware provided by feld.

Reviewed by: marius

7 years agoAdd checks for received mode page length.
mav [Tue, 10 Jan 2017 20:52:44 +0000 (20:52 +0000)]
Add checks for received mode page length.

If our buffer is too small, we may receive part of the page, and should
not try read/write past the end of the buffer.

Reported by: Coverity
CID: 13683741368375
MFC after: 1 week

7 years agoRemove unused __gnu_inline() attribute.
pfg [Tue, 10 Jan 2017 20:44:31 +0000 (20:44 +0000)]
Remove unused __gnu_inline() attribute.

This was meant to be used by a future FORTIFY_SOURCE implementation.
Probably for good, FORTIFY_SOURCE and this particular GCCism were never
well supported by clang or other compilers. Furthermore, the technology
has long since been replaced by either static checkers, sanitizers, or
even just the strong stack protector that was enabled by default.

Drop __gnu_inline to avoid cluttering the headers.

MFC after: 5 days

7 years agoFix memory leaks during "tail -r" of an irregular file
asomers [Tue, 10 Jan 2017 20:43:32 +0000 (20:43 +0000)]
Fix memory leaks during "tail -r" of an irregular file

* Rewrite r_buf to use standard tail queues instead of a hand-rolled
  circular linked list. Free dynamic allocations when done.
* Remove an optimization for the case where the file is a multiple of 128KB
  in size and there is a scarcity of memory.
* Add ATF tests for "tail -r" and its variants.

Reported by: Valgrind
Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9067

7 years agoFix typo from change 310985 in ObsoleteFiles.inc
asomers [Tue, 10 Jan 2017 20:37:44 +0000 (20:37 +0000)]
Fix typo from change 310985 in ObsoleteFiles.inc

MFC after: 16 days
X-MFC-With: 310803
Sponsored by: Spectra Logic Corp

7 years agoATFify the geom gate tests.
asomers [Tue, 10 Jan 2017 20:35:09 +0000 (20:35 +0000)]
ATFify the geom gate tests.

This ensures their cleanup routines will be run even if they should timeout.

tests/sys/geom/class/gate/ggate_test.sh
tests/sys/geom/class/gate/Makefile
Add an ATF test with three testcases, one for each TAP test. Use
ATF-style cleanup functions, and convert sleeps to polling loops.

ObsoleteFiles.inc
tests/sys/geom/class/gate/conf.sh
tests/sys/geom/class/gate/1_test.sh
tests/sys/geom/class/gate/2_test.sh
tests/sys/geom/class/gate/3_test.sh
Delete TAP test files

Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8891

7 years agoDo not wait for HA thread shutdown if scheduler is stopped.
mav [Tue, 10 Jan 2017 20:16:16 +0000 (20:16 +0000)]
Do not wait for HA thread shutdown if scheduler is stopped.

This wait loop made system hang on panic instead of reboot.

MFC after: 1 week

7 years ago[efi] Build EFI bits with -fPIC on ARM
gonzo [Tue, 10 Jan 2017 20:15:24 +0000 (20:15 +0000)]
[efi] Build EFI bits with -fPIC on ARM

clang 3.9.0 without -fPIC generates absolute jump table for
switch/case statement which trips boot1.efi and loader.efi
on ARM platform.

Reviewed by: andrew
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9108

7 years ago[efi] Fix .rel.data.* being erroneously merged into .data on ARM
gonzo [Tue, 10 Jan 2017 20:12:07 +0000 (20:12 +0000)]
[efi] Fix .rel.data.* being erroneously merged into .data on ARM

Fix section pattern code to exclude .rel.data.* sections from being
merged into .data. Otherwise relocations in those sections are lost
in final binary

Reviewed by: andrew
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9108

7 years ago[efi] Fix off-by-one error in ARM .bss zeroing code in loader's _start
gonzo [Tue, 10 Jan 2017 20:08:21 +0000 (20:08 +0000)]
[efi] Fix off-by-one error in ARM .bss zeroing code in loader's _start

__bss_end should not be included in .bss zeroing code. Otherwise first 4
bytes of the section that follows .bss (in loader's case it's .sdata) are
overwritten by zero.

Reviewed by: andrew
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9108

7 years agoFix build without IEEE80211_DEBUG.
pluknet [Tue, 10 Jan 2017 19:28:40 +0000 (19:28 +0000)]
Fix build without IEEE80211_DEBUG.

Reported by: many

7 years agoFix acquisition of nested write compat rtld locks.
kib [Tue, 10 Jan 2017 19:26:55 +0000 (19:26 +0000)]
Fix acquisition of nested write compat rtld locks.

Obtaining compat rtld lock in write mode sets process signal mask to
block all signals.  Previous mask is stored in the global variable
oldsigmask.  If a lock is write-locked while another lock is already
write-locked, oldsigmask is overwritten by the total mask and on the
last unlock, all signals except traps appear to be blocked.

Fix this by counting the write-lock nested level, and only storing to
oldsigmask/restoring from it at the outermost level.

Masking signals disables involuntary preemption for libc_r, and there
could be no voluntary context switches in the locked code
(dl_iterate_phdr(3) keeps a lock around user callback, but it was
added long after libc_r was renounced).  Due to this, remembering the
level in the global variable after the lock is obtained should be
safe, because no two libc_r threads can acquire different write locks
in parallel.

PR: 215826
Reported by: kami
Tested by: yamagi@yamagi.org (previous version)
To be reviewed by: kan
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoReplace using of objdump with elfdump
lwhsu [Tue, 10 Jan 2017 18:46:40 +0000 (18:46 +0000)]
Replace using of objdump with elfdump

In-tree objdump is too old to dump new ELF headers.  But for example if we
use: `make CROSS_TOOLCHAIN=riscv64-gcc TARGET_ARCH=riscv64` and do not specify
CROSS_BINUTILS_PREFIX in env, embed_mfs.sh cannot find the correct objdump.
This patch just replaces using of objdump with elfdump to collect needed
information.

Later we may also put an ELFDUMP in CROSSENV and use it in embed_mfs.sh .

Reviewed by: emaste, br
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9062

7 years agoThe iw_cxgb and iw_cxgbe drivers should not use a FreeBSD device_t where
np [Tue, 10 Jan 2017 18:39:53 +0000 (18:39 +0000)]
The iw_cxgb and iw_cxgbe drivers should not use a FreeBSD device_t where
a linuxkpi style device is expected.  If OFED/linuxkpi actually starts
using this field then we'll have to figure out whether to create fake
devices for these drivers or have linuxkpi deal with NULL device.

This mismatch was first reported as part of D6585.

7 years agoUse ANSI C definitions, update comment.
kib [Tue, 10 Jan 2017 17:05:34 +0000 (17:05 +0000)]
Use ANSI C definitions, update comment.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agosfxge(4): avoid unnecessary mbuf data prefetch
arybchik [Tue, 10 Jan 2017 16:25:39 +0000 (16:25 +0000)]
sfxge(4): avoid unnecessary mbuf data prefetch

Unnecessary prefetch just loads HW prefetcher and displaces other
cache entries (which could be really useful).

If we parse mbuf for TSO early and use firmware-assisted TSO, we do not
expect mbuf data access when we compose firmware-assisted TSO (v1 or v2)
option descriptors.  If packet header needs to be linearized or finally
FATSO cannot be used because of, for example, too big header, we do not
care about a bit more performance degradation because of prefetch
absence (it is better to optimize more common case).

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9120

7 years agoTeach crunchide about EM_S390 to make bootstrapping from future
bz [Tue, 10 Jan 2017 14:40:30 +0000 (14:40 +0000)]
Teach crunchide about EM_S390 to make bootstrapping from future
releases easier unless someone will fix the PR properly.

MFC after: 3 days
PR: 215940

7 years agoAdd acpi_if.h to SRCS so we have it when building ahci_generic.c with ACPI.
andrew [Tue, 10 Jan 2017 13:36:33 +0000 (13:36 +0000)]
Add acpi_if.h to SRCS so we have it when building ahci_generic.c with ACPI.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

7 years agoAdd an ACPI attachment to the existing ahci_generic driver. This is used
andrew [Tue, 10 Jan 2017 10:56:33 +0000 (10:56 +0000)]
Add an ACPI attachment to the existing ahci_generic driver. This is used
in some arm64 hardware, for example the AMD Opteron A1100.

Reviewed by: mav
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8852

7 years agoFix malloc(M_WAITOK) under mutex, introduced at r311787.
mav [Tue, 10 Jan 2017 10:33:36 +0000 (10:33 +0000)]
Fix malloc(M_WAITOK) under mutex, introduced at r311787.

MFC after: 13 days

7 years agoDiff reduce with upstream by removing signal.h #include
ngie [Tue, 10 Jan 2017 10:27:09 +0000 (10:27 +0000)]
Diff reduce with upstream by removing signal.h #include

MFC after: 3 days

7 years agoMerge ^/vendor/NetBSD/tests/dist@r311868
ngie [Tue, 10 Jan 2017 10:16:59 +0000 (10:16 +0000)]
Merge ^/vendor/NetBSD/tests/dist@r311868

This is the vendor accepted version of ^/head@r311245

MFC after: 3 days

7 years agoMerge the grammar fix for lib/libc/gen/raise_test:raise_stress
ngie [Tue, 10 Jan 2017 10:12:36 +0000 (10:12 +0000)]
Merge the grammar fix for lib/libc/gen/raise_test:raise_stress

MFC after: 3 days

7 years ago[net80211] add VHT mediatype initialisation and update helper functions.
adrian [Tue, 10 Jan 2017 07:50:21 +0000 (07:50 +0000)]
[net80211] add VHT mediatype initialisation and update helper functions.

7 years ago[net80211] Add default parameters for 11ac.
adrian [Tue, 10 Jan 2017 07:24:29 +0000 (07:24 +0000)]
[net80211] Add default parameters for 11ac.

I doubt TDMA code will ever work for 11ac, but you never know, someone
may one day make it happen.

7 years ago[net80211] add VHT action frame placeholders for when it's time to implement.
adrian [Tue, 10 Jan 2017 07:21:07 +0000 (07:21 +0000)]
[net80211] add VHT action frame placeholders for when it's time to implement.

7 years agoAdd my birthday to calendar.freebsd
ler [Tue, 10 Jan 2017 05:37:53 +0000 (05:37 +0000)]
Add my birthday to calendar.freebsd

Approved by: adamw (Mentor)
Differential Revision: https://reviews.freebsd.org/D9119

7 years ago[net80211] add missing VHTCAP declaration changes.
adrian [Tue, 10 Jan 2017 05:33:34 +0000 (05:33 +0000)]
[net80211] add missing VHTCAP declaration changes.

These are required for the recent ieee80211_vht.[ch] changes -
they make things start to work with MS() / SM() macros.

7 years ago[net80211] add CHAN_VHT2G/CHAN_VHT5G macros.
adrian [Tue, 10 Jan 2017 05:32:30 +0000 (05:32 +0000)]
[net80211] add CHAN_VHT2G/CHAN_VHT5G macros.

7 years ago[net80211] add VHT EDCA parameters for WME/QoS mode.
adrian [Tue, 10 Jan 2017 05:32:02 +0000 (05:32 +0000)]
[net80211] add VHT EDCA parameters for WME/QoS mode.

7 years ago[net80211] create a helper function to calculate the station facing VHT capabilities.
adrian [Tue, 10 Jan 2017 05:30:15 +0000 (05:30 +0000)]
[net80211] create a helper function to calculate the station facing VHT capabilities.

This is needed for two reasons:

* Drivers will need to know what the negotiated set of VHT capabilities
  and rates are in order to configure (and reconfigure for opmode/chanwidth
  changes) how to speak to a given peer; and
* Because some vendors are "special", we should be careful in what we announce
  to them during peer association.

This isn't the complete solution, as I still need to make sure that when
sending out probe requests before we know what we want, we don't limit
the capabilities being announced.  This is important for IBSS/mesh work
later on as probe request/response exchanges are the first hint at what
a peer supports.  I'll look at adding that to the API soon.

7 years agoAdd copywrite notices, 2-clause BSD.
sbruno [Tue, 10 Jan 2017 04:50:26 +0000 (04:50 +0000)]
Add copywrite notices, 2-clause BSD.

Reported by: jmallett

7 years agoAs much as I've enjoyed being listed as emeritus for the last 10+ years,
adamw [Tue, 10 Jan 2017 04:49:59 +0000 (04:49 +0000)]
As much as I've enjoyed being listed as emeritus for the last 10+ years,
it's probably time to admit that I am an active committer.

7 years agoAdd myself to committers-ports.dot
ler [Tue, 10 Jan 2017 04:31:56 +0000 (04:31 +0000)]
Add myself to committers-ports.dot

Approved by: adamw (mentor)
Differential Revision: https://reviews.freebsd.org/D9117

7 years agocd9660: fix up compilation on sparc after r311665
mjg [Tue, 10 Jan 2017 04:17:53 +0000 (04:17 +0000)]
cd9660: fix up compilation on sparc after r311665

Reported by: linimon

7 years agoUse the post-reset hook to force the controller to host mode. This will
ian [Tue, 10 Jan 2017 03:53:38 +0000 (03:53 +0000)]
Use the post-reset hook to force the controller to host mode.  This will
make both usb ports work on imx6 systems (the OTG port of course will only
work in host mode).

7 years agoMigrate e1000 to the IFLIB framework:
sbruno [Tue, 10 Jan 2017 03:23:22 +0000 (03:23 +0000)]
Migrate e1000 to the IFLIB framework:
- em(4) igb(4) and lem(4)
- deprecate the igb device from kernel configurations
- create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko

Devices tested:
- 82574L
- I218-LM
- 82546GB
- 82579LM
- I350
- I217

Please report problems to freebsd-net@freebsd.org

Partial review from jhb and suggestions on how to *not* brick folks who
originally would have lost their igbX device.

Submitted by: mmacy@nextbsd.org
MFC after: 2 weeks
Relnotes: yes
Sponsored by: Limelight Networks and Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8299

7 years agocxgbe(4): Attach to the 2x25 debug card. This is for internal use only.
np [Tue, 10 Jan 2017 01:36:50 +0000 (01:36 +0000)]
cxgbe(4): Attach to the 2x25 debug card.  This is for internal use only.

MFC after: 3 days

7 years agoAllow udbp(4) to claim Belkin "Windows Easy Transfer Cable" for Netgraph use.
bms [Tue, 10 Jan 2017 01:31:26 +0000 (01:31 +0000)]
Allow udbp(4) to claim Belkin "Windows Easy Transfer Cable" for Netgraph use.

These have been tested back-to-back with Linux 3.x and a similar attachment
at the other end; a CDC EEM-like encapsulation can be used for emulated
Ethernet over udbp(4) with ng_ether.

7 years agocxgbe(4): Refresh t4_msg.h, mainly for definitions related to the crypto
np [Tue, 10 Jan 2017 01:30:41 +0000 (01:30 +0000)]
cxgbe(4): Refresh t4_msg.h, mainly for definitions related to the crypto
engine.

Obtained from: Chelsio Communications
MFC after: 2 weeks
Sponsored by: Chelsio Communications

7 years agortwn_pci(4): fix possible race while accessing 'matched_chip' variable.
avos [Tue, 10 Jan 2017 01:09:39 +0000 (01:09 +0000)]
rtwn_pci(4): fix possible race while accessing 'matched_chip' variable.

7 years agoAdd PID for Belkin F5U258 "Windows Easy Transfer Cable", a udbp-like device.
bms [Tue, 10 Jan 2017 00:28:01 +0000 (00:28 +0000)]
Add PID for Belkin F5U258 "Windows Easy Transfer Cable", a udbp-like device.

7 years agoAdjust ACPI_EXPORT_SYMBOL for AcpiGetTableWithSize
cem [Tue, 10 Jan 2017 00:03:43 +0000 (00:03 +0000)]
Adjust ACPI_EXPORT_SYMBOL for AcpiGetTableWithSize

Suggested by: jbeich@

7 years agocd9660: typedef cd_ino_t in preference to #define
cem [Mon, 9 Jan 2017 23:56:45 +0000 (23:56 +0000)]
cd9660: typedef cd_ino_t in preference to #define

Suggested by: kib@

7 years agocd9660: Add a prototype for cd9660_vfs_hash_cmp
cem [Mon, 9 Jan 2017 23:51:31 +0000 (23:51 +0000)]
cd9660: Add a prototype for cd9660_vfs_hash_cmp

GCC warns (and errors, with -Werror) about it otherwise.  Clang doesn't care.

Introduced in r311665.

Reported by: np@

7 years agoWhite space cleanup from an cut-n-paste.
sbruno [Mon, 9 Jan 2017 23:45:40 +0000 (23:45 +0000)]
White space cleanup from an cut-n-paste.

Submitted by: mmacy@nextbsd.org

7 years agortwn_usb(4): do not try to modify global static structure.
avos [Mon, 9 Jan 2017 23:42:02 +0000 (23:42 +0000)]
rtwn_usb(4): do not try to modify global static structure.

Use a local copy for modifications instead.

Tested with RTL8821AU (AP) + RTL8188EU (STA).

Reported by: hselasky

7 years agoRemove unused mtx_held() macro.
sbruno [Mon, 9 Jan 2017 23:41:10 +0000 (23:41 +0000)]
Remove unused mtx_held() macro.

7 years agocxgbe(4): Enable automatic cidx flush for all control queues.
np [Mon, 9 Jan 2017 22:20:09 +0000 (22:20 +0000)]
cxgbe(4): Enable automatic cidx flush for all control queues.

MFC after: 3 days

7 years agocxgbe(4): The wraparound logic in start_wrq_wr() should not get involved
np [Mon, 9 Jan 2017 22:18:08 +0000 (22:18 +0000)]
cxgbe(4): The wraparound logic in start_wrq_wr() should not get involved
in work requests that end at the end of the descriptor ring, even though
the pidx wraps around to 0.

MFC after: 3 days

7 years ago[rsu] add support for the "green" rsu NICs.
adrian [Mon, 9 Jan 2017 21:46:24 +0000 (21:46 +0000)]
[rsu] add support for the "green" rsu NICs.

They're still a 1T2R NIC, so reuse the same rfconfig and
nstream configuration.

Submitted by: Idwer Vollering <vidwer@gmail.com>

7 years agoIn dummynet(4), random chunks of memory are casted to struct dn_*,
marius [Mon, 9 Jan 2017 20:51:51 +0000 (20:51 +0000)]
In dummynet(4), random chunks of memory are casted to struct dn_*,
potentially leading to fatal unaligned accesses on architectures with
strict alignment requirements. This change fixes dummynet(4) as far
as accesses to 64-bit members of struct dn_* are concerned, tripping
up on sparc64 with accesses to 32-bit members happening to be correctly
aligned there. In other words, this only fixes the tip of the iceberg;
larger parts of dummynet(4) still need to be rewritten in order to
properly work on all of !x86.
In principle, considering the amount of code in dummynet(4) that needs
this erroneous pattern corrected, an acceptable workaround would be to
declare all struct dn_* packed, forcing compilers to do byte-accesses
as a side-effect. However, given that the structs in question aren't
laid out well either, this would break ABI/KBI.
While at it, replace all existing bcopy(9) calls with memcpy(9) for
performance reasons, as there is no need to check for overlap in these
cases.

PR: 189219
MFC after: 5 days

7 years agoForcibly remove the cached items from pseudofs vncache on module unload.
kib [Mon, 9 Jan 2017 20:14:18 +0000 (20:14 +0000)]
Forcibly remove the cached items from pseudofs vncache on module unload.

If some process' nodes were accessed using procfs and the process
cannot exit properly at the time modunload event is reported to the
pseudofs-backed filesystem, the assertion in pfs_vncache_unload() is
triggered.  Assertion is correct, the cache should be cleaned.

Approved by: des (pseudofs maintainer)
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAvoid taking the address of a packed struct member in mfiutil
dim [Mon, 9 Jan 2017 19:39:35 +0000 (19:39 +0000)]
Avoid taking the address of a packed struct member in mfiutil

Fix a clang 4.0.0 warning about taking the address of a packed member of
struct mfi_evt in mfiutil:

    usr.sbin/mfiutil/mfi_evt.c:583:30: error: taking address of packed
    member 'members' of class or structure 'mfi_evt' may result in an
    unaligned pointer value [-Werror,-Waddress-of-packed-member]
                            if (parse_locale(optarg, &filter.members.locale) < 0) {
                                                      ^~~~~~~~~~~~~~~~~~~~~

Use a local variable instead, and copy that into the struct.

Reviewed by: jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9069

7 years agoAdd recently added libc++ headers to OptionalObsoleteFiles.inc.
dim [Mon, 9 Jan 2017 19:22:29 +0000 (19:22 +0000)]
Add recently added libc++ headers to OptionalObsoleteFiles.inc.

MFC after: 3 days

7 years agoAfter r311565, also remove llvm-ranlib from ObsoleteFiles.inc.
dim [Mon, 9 Jan 2017 19:12:41 +0000 (19:12 +0000)]
After r311565, also remove llvm-ranlib from ObsoleteFiles.inc.

7 years agoRewrite CTL statistics in more simple and scalable way.
mav [Mon, 9 Jan 2017 18:18:15 +0000 (18:18 +0000)]
Rewrite CTL statistics in more simple and scalable way.

Instead of collecting statistics for each combination of ports and logical
units, that consumed ~45KB per LU with present number of ports, collect
separate statistics for every port and every logical unit separately, that
consume only 176 bytes per each single LU/port.  This reduces struct
ctl_lun size down to just 6KB.

Also new IOCTL API/ABI does not hardcode number of LUs/ports, and should
allow handling of very large quantities.

MFC after: 2 weeks (probably keeping old API enabled for some time)

7 years agoAdd sdhci_handle_card_present_locked() that can be called from the interrupt
ian [Mon, 9 Jan 2017 17:10:50 +0000 (17:10 +0000)]
Add sdhci_handle_card_present_locked() that can be called from the interrupt
handler which already holds the mutex, and have sdhci_handle_card_present()
be just a tiny wrapper that does the locking for external callers.

This should fix the recursive locking panics seen on rpi3.

Reported by: Shawn Webb

7 years ago- Add support for Intel Apollo Lake and Bay Trail eMMC controllers.
marius [Mon, 9 Jan 2017 17:07:13 +0000 (17:07 +0000)]
- Add support for Intel Apollo Lake and Bay Trail eMMC controllers.
  Besides slots always having non-removable media, these HCIs require
  a custom hardware reset sequence after power-up.
- Flesh out the support for Intel Braswell eMMC controllers further.
  Apart from also requiring said reset code, the timeout clock needs to
  be hardcoded to 1 MHz for these.
  Both the special reset and timeout clock handlings are implemented as
  global sdhci(4) quirks as the same treatment will be necessary for
  Intel eMMC controllers attached via ACPI (once sdhci(4) grows such a
  front-end).
- In sdhci_init_slot(), use the right capability field for determining
  the announced bus width based on MMC_CAP_*_BIT_DATA.
- Correct inverted sdhci_pci_softc member comments added in r276469. [1]

Submitted by: Anton Yuzhaninov [1]
MFC after: 5 days

7 years agoIn mmcsd_task(), bio_resid was not being set to 0 on a successful read
marius [Mon, 9 Jan 2017 17:05:39 +0000 (17:05 +0000)]
In mmcsd_task(), bio_resid was not being set to 0 on a successful read
or write, resulting in random short-read and short-write returns for
requests. Fixing this fixes nominal block I/O via mmcsd(4).

Obtained from: DragonFlyBSD (fd4b97583be1a1e57234713c25f6e81bc0411cb0)
MFC after: 5 days

7 years agoAllocate memory for prevent flags only for removable LUs.
mav [Mon, 9 Jan 2017 16:21:06 +0000 (16:21 +0000)]
Allocate memory for prevent flags only for removable LUs.

This array takes 64KB of RAM now, that was more then half of struct ctl_lun
size.  If at some point we support more ports, this may need another tune.

MFC after: 2 weeks

7 years agoUse standard Versions.def for libprocstat.
kib [Mon, 9 Jan 2017 11:11:52 +0000 (11:11 +0000)]
Use standard Versions.def for libprocstat.

This makes the versions inheritance consistent for our versioned libraries.

Extracted from: ino64
Discussed with: kan
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUse tab for indent.
kib [Mon, 9 Jan 2017 10:47:20 +0000 (10:47 +0000)]
Use tab for indent.

Extracted from: ino64 work by gleb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFix rstat: symbol not in namelist from netstat
smh [Mon, 9 Jan 2017 09:28:03 +0000 (09:28 +0000)]
Fix rstat: symbol not in namelist from netstat

Load kvm symbols earlier to prevent rstat: symbol not in namelist
error when running netstat -rs.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 1 week
Sponsored by: Multiplay

7 years agoFix typo.
delphij [Mon, 9 Jan 2017 07:36:31 +0000 (07:36 +0000)]
Fix typo.

MFC after: 3 days

7 years agoAdd a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB file
ngie [Mon, 9 Jan 2017 06:36:17 +0000 (06:36 +0000)]
Add a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB file

This change also documents the modification harti made to a handful of
objects in r122758 (the max OCTET STRING width was increased from 15 to
31 octets)

MFC after: 1 week

7 years agoAdd a REVISION section to track changes for the BEGEMOT-MIB MIB file
ngie [Mon, 9 Jan 2017 06:27:30 +0000 (06:27 +0000)]
Add a REVISION section to track changes for the BEGEMOT-MIB MIB file

There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

MFC after: 1 week

7 years agoAdd a REVISION section to track changes for the FOKUS-MIB MIB file
ngie [Mon, 9 Jan 2017 06:24:28 +0000 (06:24 +0000)]
Add a REVISION section to track changes for the FOKUS-MIB MIB file

There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

MFC after: 1 week

7 years agoAdd a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB file
ngie [Mon, 9 Jan 2017 06:19:20 +0000 (06:19 +0000)]
Add a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB file

There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

MFC after: 1 week

7 years agoSimilar to r311750, check for the result from smiGetModule to avoid a segfault
ngie [Mon, 9 Jan 2017 06:13:27 +0000 (06:13 +0000)]
Similar to r311750, check for the result from smiGetModule to avoid a segfault
when dereferencing a NULL pointer later on.

Choose to just check for the NULL pointer in the next for-loop for now to fix
the issue with a minimal amount of code churn

sys/queue.h use here would make more sense than using a static table

MFC after: 5 days

7 years agoUse calloc instead of malloc + memset(.., 0, ..)
ngie [Mon, 9 Jan 2017 06:03:49 +0000 (06:03 +0000)]
Use calloc instead of malloc + memset(.., 0, ..)

MFC after: 5 days

7 years agoCheck result from smiGetFirstNode and smiGetNodeByOID
ngie [Mon, 9 Jan 2017 05:51:38 +0000 (05:51 +0000)]
Check result from smiGetFirstNode and smiGetNodeByOID

This avoids a segfault with malformed or unanticipated files,
like IPV6-TC.txt (a file containing just TEXTUAL-CONVENTIONS).

MFC after: 5 days
Found with: gensnmpdef /usr/local/share/snmp/mibs/IPV6-TC.txt

7 years agoBump WARNS up from 0 to 6
ngie [Mon, 9 Jan 2017 05:46:41 +0000 (05:46 +0000)]
Bump WARNS up from 0 to 6

MFC after: 5 days

7 years agoDocument bsd.snmpmod.mk from a high-level
ngie [Mon, 9 Jan 2017 04:35:55 +0000 (04:35 +0000)]
Document bsd.snmpmod.mk from a high-level

MFC after: 2 weeks

7 years agohyperv: Add method to read 64bit Hyper-V specific time value.
sephe [Mon, 9 Jan 2017 03:38:41 +0000 (03:38 +0000)]
hyperv: Add method to read 64bit Hyper-V specific time value.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D9057

7 years agoAdd a REVISION section to track changes for the BEGEMOT-IP-MIB MIB file
ngie [Mon, 9 Jan 2017 03:21:21 +0000 (03:21 +0000)]
Add a REVISION section to track changes for the BEGEMOT-IP-MIB MIB file

There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

MFC after: 1 week

7 years agoAdd a REVISION section to track changes for the hostres module
ngie [Mon, 9 Jan 2017 03:18:19 +0000 (03:18 +0000)]
Add a REVISION section to track changes for the hostres module

There haven't been any changes to the MIB definition, so the REVISION remains
static at the version it was imported at

MFC after: 1 week

7 years agoImprove the smilint target in the hostres and mibII modules
ngie [Mon, 9 Jan 2017 03:14:04 +0000 (03:14 +0000)]
Improve the smilint target in the hostres and mibII modules

- Mark the smilint target .PHONY so it's always executed when requested
- Leverage .PATH for BMIBS instead of spelling the path out longhand
  for them

MFC after: 1 week

7 years agoUse SRCTOP instead of spelling out the full path with .CURDIR
ngie [Mon, 9 Jan 2017 03:08:21 +0000 (03:08 +0000)]
Use SRCTOP instead of spelling out the full path with .CURDIR

This helps condense the output for CFLAGS and .PATH

MFC after: 3 days

7 years agoUse the new sdhci_fdt_gpio helper functions to add full support for FDT
ian [Mon, 9 Jan 2017 02:04:54 +0000 (02:04 +0000)]
Use the new sdhci_fdt_gpio helper functions to add full support for FDT
gpio pins for detecting card insert/remove and write protect.

7 years agoUse the new sdhci_fdt_gpio helper functions to add full support for FDT
ian [Mon, 9 Jan 2017 01:57:51 +0000 (01:57 +0000)]
Use the new sdhci_fdt_gpio helper functions to add full support for FDT
gpio pins for detecting card insert/remove and write protect.

7 years agoAdd new helper routines for sdhci bridge drivers that use gpio pins for
ian [Mon, 9 Jan 2017 01:54:36 +0000 (01:54 +0000)]
Add new helper routines for sdhci bridge drivers that use gpio pins for
card presence and write protect switch detection.

A bridge driver just needs to call the setup routine in its attach(), the
teardown in its detach(), and write a couple tiny glue functions to connect
the sdhci interface functions to the new helper functions.  This is not
extensively documented, but multiple examples will exist real soon.

7 years agoUse nitems(mib) instead of hardcoding mib's length when calling sysctl(3)
ngie [Mon, 9 Jan 2017 01:47:00 +0000 (01:47 +0000)]
Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3)

MFC after: 3 days

7 years agoAdd support for non-removable media, and a quirk to use polling to detect
ian [Mon, 9 Jan 2017 01:15:18 +0000 (01:15 +0000)]
Add support for non-removable media, and a quirk to use polling to detect
card insert/remove events on controllers that don't implement the insert
and remove interrupts.

Bridge drivers can set a new slot option, SDHCI_NON_REMOVABLE, to indicate
non-removable media (such as eMMC).  The sdhci driver will not enable
insert/remove interrupts, and sdhci_generic_get_card_present() will always
return true.

Bridge drivers can set a new quirk, SDHCI_QUIRK_POLL_CARD_PRESENT, and the
sdhci driver will not enable insert/remove interrupts, and instead will use
a callout to poll the card-present status at 5 Hz.

For bridge drivers that get notified of card insert/remove via gpio
interrupts, there is a new sdhci_handle_card_present() function they can
call from the gpio interrupt handler to inform the sdhci code of the event.

In addition to adding these new features, the existing code to debounce card
insertions was updated to use taskqueue_enqueue_timeout() instead of
scheduling a callout to do the taskqueue_enqueue().  There is also now a
comment explaining that insertion-debounce is what's going on -- it took me
a long time to realize that's what the old sdhci_card_delay() routine was
really doing.  There is no functional difference between the old and new
debounce code (I hope!).

7 years agoUse nitems({mib,name}) instead of hardcoding their value
ngie [Mon, 9 Jan 2017 00:54:18 +0000 (00:54 +0000)]
Use nitems({mib,name}) instead of hardcoding their value

MFC after: 3 days

7 years agolib/libutil/kinfo_*: style cleanup
ngie [Mon, 9 Jan 2017 00:47:23 +0000 (00:47 +0000)]
lib/libutil/kinfo_*: style cleanup

- Use nitems(mib) instead of hardcoding mib's length
- Sort sys/ #includes

MFC after: 3 days

7 years agoUse nitems(mib) instead of hardcoding mib's length
ngie [Mon, 9 Jan 2017 00:38:19 +0000 (00:38 +0000)]
Use nitems(mib) instead of hardcoding mib's length

MFC after: 3 days

7 years agoSort #includes
ngie [Mon, 9 Jan 2017 00:37:09 +0000 (00:37 +0000)]
Sort #includes

MFC after: 3 days

7 years agoClean up trailing whitespace
ngie [Mon, 9 Jan 2017 00:33:27 +0000 (00:33 +0000)]
Clean up trailing whitespace

MFC after: 3 days

7 years agoStyle fixes
ngie [Mon, 9 Jan 2017 00:29:23 +0000 (00:29 +0000)]
Style fixes

- Delete trailing whitespace
- Use nitems(mib) instead of hardcoding the mib length

MFC after: 3 days

7 years agoStyle(9) fixes
ngie [Mon, 9 Jan 2017 00:25:33 +0000 (00:25 +0000)]
Style(9) fixes

- Sort sys/ #includes
- Use nitems instead of hardcoding the length of `mib`

MFC after: 3 days

7 years agortwn_usb(4): fix Rx buffer size calculation.
avos [Sun, 8 Jan 2017 23:41:17 +0000 (23:41 +0000)]
rtwn_usb(4): fix Rx buffer size calculation.

Use device-specific Rx buffer size to ensure that data will not be
truncated + add a warning if truncation was detected (the driver
cannot handle this case correctly yet).

Tested with:
 - RTL8188CUS, RTL8188EU and RTL8821AU, STA / AP modes.

7 years agoUpdate pciids to 2017.01.08
bapt [Sun, 8 Jan 2017 23:25:46 +0000 (23:25 +0000)]
Update pciids to 2017.01.08

MFC after: 1 day

7 years agoKnock a page off VM_MAX_KERNEL_ADDRESS
jhibbits [Sun, 8 Jan 2017 21:12:46 +0000 (21:12 +0000)]
Knock a page off VM_MAX_KERNEL_ADDRESS

There are places where checks are made against VM_MAX_KERNEL_ADDRESS, or
virtual_end (set to VM_MAX_KERNEL_ADDRESS).  With 32-bit checks, an address will
always be less than or equal to 0xffffffff.  Drop a page, so those checks can
terminate loops safely.

7 years agoUse correct PCI device id for virtio-rng.
grehan [Sun, 8 Jan 2017 20:58:58 +0000 (20:58 +0000)]
Use correct PCI device id for virtio-rng.
This prevented the device from attaching with a
Windows guest (most other guests use the device type
for matching)

PR: 212711
Submitted by: jbeich
MFC after: 3 days