]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoCleanup redundant parenthesis from existing howmany()/roundup() macro uses.
pfg [Fri, 22 Apr 2016 16:57:42 +0000 (16:57 +0000)]
Cleanup redundant parenthesis from existing howmany()/roundup() macro uses.

8 years ago[bhnd] use correct bus deallocation method
adrian [Fri, 22 Apr 2016 16:28:41 +0000 (16:28 +0000)]
[bhnd] use correct bus deallocation method

Submitted by: Mizhka Zhilin <mizhka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D5647

8 years ago[bhnd] Update bhndb format strings to match long -> rman_res_t size change.
adrian [Fri, 22 Apr 2016 16:27:35 +0000 (16:27 +0000)]
[bhnd] Update bhndb format strings to match long -> rman_res_t size change.

Does what it says on the tin; this unbreaks 32-bit builds.

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D5764

8 years ago[bhnd] Add a common bhnd_pci driver shared by both bhnd_pcib and bhnd_pci_hostb
adrian [Fri, 22 Apr 2016 16:26:53 +0000 (16:26 +0000)]
[bhnd] Add a common bhnd_pci driver shared by both bhnd_pcib and bhnd_pci_hostb

This extracts common code from bhndb_pci, bhnd_pcib, and bhnd_pci_hostb into a
simpler shared bhnd_pci base driver, and should enable SoC-side implementation
of bhnd_pcib root complex support.

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D5763

8 years agoFix more pc98 build issues re: bcache change
allanjude [Fri, 22 Apr 2016 16:20:58 +0000 (16:20 +0000)]
Fix more pc98 build issues re: bcache change

Reported by: bz, emaste

8 years agoClear the DDR memory. This should be done by bootloaders,
br [Fri, 22 Apr 2016 16:15:58 +0000 (16:15 +0000)]
Clear the DDR memory. This should be done by bootloaders,
but they have no such feature yet.

This fixes operation on Rocket Core and lowRISC.

8 years agoAdd memory barriers (fence instructions) so the data wrotten by hardware
br [Fri, 22 Apr 2016 15:12:05 +0000 (15:12 +0000)]
Add memory barriers (fence instructions) so the data wrotten by hardware
to physical address now can be read by VA.

This fixes operation on Rocket Core (FPGA).

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoCorrect the event queue initialization.
br [Fri, 22 Apr 2016 15:04:46 +0000 (15:04 +0000)]
Correct the event queue initialization.
This fixes operation on Rocket Core.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agolahf/sahf are supported on some amd64 processors
avg [Fri, 22 Apr 2016 13:44:12 +0000 (13:44 +0000)]
lahf/sahf are supported on some amd64 processors

While the instructions were not included into the original instruction
set, their support can be indicated by a special feature bit.
For example:
  CPU: AMD Phenom(tm) II X4 955 Processor (3214.71-MHz K8-class CPU)
  ...
    AMD Features2=0x37ff<LAHF, ...>

Clang 3.8 uses lahf/sahf as a faster alternative to pushf/popf where
possible.

MFC after: 2 weeks

8 years agoMFV r298471: 6052 decouple lzc_create() from the implementation details
avg [Fri, 22 Apr 2016 13:00:27 +0000 (13:00 +0000)]
MFV r298471: 6052 decouple lzc_create() from the implementation details

illumos/illumos-gate@26455f9efcf9b1e44937d4d86d1ce37b006f25a9
https://github.com/illumos/illumos-gate/commit/26455f9efcf9b1e44937d4d86d1ce37b006f25a9

https://www.illumos.org/issues/6052
  At the moment type parameter of lzc_create() is of dmu_objset_type_t type.
  That exposes an implementation detail and requires sys/fs/zfs.h to be included
  in libzfs_core.h creating unnecessary coupling between libzfs_core interface
  and ZFS internals.
  I think that dmu_objset_type_t should be replaced with a libzfs_core
  enumeration of supported dataset types.
  For ABI reasons the new enumeration could be bit-compatible with
  dmu_objset_type_t.
  For example:
      typedef enum {
          LZC_DST_ZFS = 2,
          LZC_DST_ZVOL
      } lzc_dataset_type_t;

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Andriy Gapon <andriy.gapon@clusterhq.com>

MFC after: 2 weeks
Sponsored by: ClusterHQ

8 years agoUse `sizeof(*uuser)` instead of `sizeof(struct usm_user)` for consistency with
ngie [Fri, 22 Apr 2016 08:11:26 +0000 (08:11 +0000)]
Use `sizeof(*uuser)` instead of `sizeof(struct usm_user)` for consistency with
the rest of the users in the file

No functional change

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd FEATURE knob for testing for UFS extended attribute kernel support
ngie [Fri, 22 Apr 2016 08:09:27 +0000 (08:09 +0000)]
Add FEATURE knob for testing for UFS extended attribute kernel support

Support can be verified via `feature_present("ufs_extattr")`, etc.

Differential Revision: https://reviews.freebsd.org/D6053
MFC after: 2 weeks
Relnotes: yes
Reviewed by: asomers, kib
Sponsored by: EMC / Isilon Storage Division

8 years agoReturn `ret` in op_ifentry(..) to mute a -Wunused-but-set-variable warning
ngie [Fri, 22 Apr 2016 07:51:38 +0000 (07:51 +0000)]
Return `ret` in op_ifentry(..) to mute a -Wunused-but-set-variable warning

This will also now detect error conditions with
value->var.subs[sub - 1] == LEAF_ifPhysAddress where `string_get(..)`
could fail if iifp->physaddr and/or iifp->physaddrlen were deemed
invalid.

MFC after: 2 weeks
CID: 1006551
Reported by: Coverity, gcc
Sponsored by: EMC / Isilon Storage Division

8 years agoFix for printf() compile warning when fast_reg.length is 64-bit.
hselasky [Fri, 22 Apr 2016 07:29:38 +0000 (07:29 +0000)]
Fix for printf() compile warning when fast_reg.length is 64-bit.
Changing fast_reg.length to 64 bits is planned in the future. Krping
uses 32-bit lengths internally.

Sponsored by: Mellanox Technologies
MFC after: 1 week

8 years agoFix duplicate TLB entries issue during section promotion/demotion.
skra [Fri, 22 Apr 2016 06:42:50 +0000 (06:42 +0000)]
Fix duplicate TLB entries issue during section promotion/demotion.
Such situation is defined as UNPREDICTABLE by arm arm manual.

This patch fixes all explicit TLB fetches which could cause this issue
and speculative TLB fetches for sections mapped in user address space.
Speculative TLB fetches for sections mapped in kernel address space are
not fixed yet as the break-before-make approach must be implemented for
kernel mappings too. This means that promoted/demoted section will be
unmapped for a while. Either kernel stack the promotion/demotion is
being done on or L1 page table(s) which must be modified may be mapped
by this section. Thus the fix will not be so simple like for userland
mappings.

The issue was detectable only on Cortex-A8 platforms and only very
rarely. It was reported few times. First, it was by Mikael Urankar
in June 2015. He helped to identify the mechanism of this issue, but
we were not sure how to fix it correctly until now.

PR: 208381
Reported by: Mikael Urankar (mikael.urankar at gmail.com)
Reviewed by: kib

8 years agoAdd KASSERT() and set error code in dead code case to help static code
hselasky [Fri, 22 Apr 2016 06:39:07 +0000 (06:39 +0000)]
Add KASSERT() and set error code in dead code case to help static code
analysis tools.

Suggested by: ngie@
Sponsored by: Mellanox Technologies
MFC after: 1 week

8 years agoAdd missing set of the current VNET when inputting IP packets in IPoIB.
hselasky [Fri, 22 Apr 2016 06:33:06 +0000 (06:33 +0000)]
Add missing set of the current VNET when inputting IP packets in IPoIB.

This fixes a kernel panic when using IPoIB with VIMAGE and infiniband.

PR: 208957
Sponsored by: Mellanox Technologies
Tested by: Justin Clift <justin@postgresql.org>
MFC after: 1 week

8 years agoDon't use atomic operations for page table entries and handle access
skra [Fri, 22 Apr 2016 06:32:27 +0000 (06:32 +0000)]
Don't use atomic operations for page table entries and handle access
and R/W emulation aborts under pmap lock.

There were two reasons for using of atomic operations:
(1) the pmap code is based on i386 one where they are used,
(2) there was an idea that access and R/W emulation aborts should be
    handled as quick as possible, without pmap locking.

However, the atomic operations in i386 pmap code are used only because
page table entries may be modified by hardware. At the beginning, we
were not sure that it's the only reason. So even if arm hardware does
not modify them, we did not risk to not use them at that time. Further,
it turns out after some testing that using of pmap lock for access and
R/W emulation aborts does not bring any extra cost and there was no
measurable difference. Thus, we have decided finally to use pmap lock
for all operations on page table entries and so, there is no reason for
atomic operations on them. This makes the code cleaner and safer.

This decision introduce a question if it's safe to use pmap lock for
access and R/W emulation aborts. Anyhow, there may happen two cases in
general:
(A) Aborts while the pmap lock is locked already - this should not
happen as pmap lock is not recursive. However, under pmap lock only
internal kernel data should be accessed and such data should be mapped
with A bit set and NM bit cleared. If double abort happens, then
a mapping of data which has caused it must be fixed.
(B) Aborts while another lock(s) is/are locked - this already can
happen. There is no difference here if it's either access or R/W
emulation abort, or if it's some other abort.

Reviewed by: kib

8 years agoAdd four functions which check a virtual address for stage 1 privileged
skra [Fri, 22 Apr 2016 06:26:45 +0000 (06:26 +0000)]
Add four functions which check a virtual address for stage 1 privileged
(PL1) and unprivileged (PL0) read/write access. As cp15 virtual to
physical address translation operations are used, interrupts must be
disabled to get consistent result when they are called.

These functions should be used only in very specific occasions like
during abort handling or kernel debugging. One of them is going to be
used in pmap_fault(). However, complete function set is added. It cost
nothing, as they are inlined.

While here, fix comment of #endif.

Reviewed by: kib

8 years agoUse MIN()/MAX() macros from sys/param.h.
araujo [Fri, 22 Apr 2016 06:25:32 +0000 (06:25 +0000)]
Use MIN()/MAX() macros from sys/param.h.

Reviewed by: grehan
Differential Revision: https://reviews.freebsd.org/D6054

8 years agoUse roundup2() macro from sys/param.h.
araujo [Fri, 22 Apr 2016 06:23:23 +0000 (06:23 +0000)]
Use roundup2() macro from sys/param.h.

MFC after: 2 weeks.

8 years agoDon't try to free `string` (stack allocated char[])
ngie [Fri, 22 Apr 2016 06:01:11 +0000 (06:01 +0000)]
Don't try to free `string` (stack allocated char[])

Fix minor style with warnx call while in the neighborhood

MFC after: 1 week
CID: 1009683
Reported by: Coverity, gcc 5.x
Sponsored by: EMC / Isilon Storage Division

8 years agoDon't use `entry` after free in the "already in lists" case
ngie [Fri, 22 Apr 2016 05:52:40 +0000 (05:52 +0000)]
Don't use `entry` after free in the "already in lists" case

Return with 0 as it isn't an error.

MFC after: 1 week
CID: 1006085
Reported by: Coverity
Obtained from: Isilon OneFS (part of r493633)
Submitted by: Thor Steingrimsson <thor.steingrimsson@isilon.com>
Sponsored by: EMC / Isilon Storage Division

8 years agoSimplify always evaluated branch (`e != NULL`)
ngie [Fri, 22 Apr 2016 05:24:15 +0000 (05:24 +0000)]
Simplify always evaluated branch (`e != NULL`)

- xalloc(..) ensures that e will be non-null via malloc + err.
- `e` is already dereferenced above, so logically it's impossible
  to hit the lower test without crashing if it was indeed NULL.

MFC after: 3 days
CID: 1007408
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division

8 years agohyperv/et: Make Hyper-V event timer a device.
sephe [Fri, 22 Apr 2016 05:15:59 +0000 (05:15 +0000)]
hyperv/et: Make Hyper-V event timer a device.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: sephe, Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5957

8 years agoDon't leak `string` in parse_define(..) when a macro has been found
ngie [Fri, 22 Apr 2016 05:14:12 +0000 (05:14 +0000)]
Don't leak `string` in parse_define(..) when a macro has been found
and the parser token != TOK_ASSIGN

MFC after: 1 week
CID: 10071871007188
Reported by: Coverity
Obtained from: Isilon OneFS (part of r445479)
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
Sponsored by: EMC / Isilon Storage Division

8 years agoUse macro MAX() from sys/param.h.
araujo [Fri, 22 Apr 2016 05:07:59 +0000 (05:07 +0000)]
Use macro MAX() from sys/param.h.

MFC after: 2 weeks.

8 years agohyperv: Update copyright to 2016 for the files Microsoft changed in 2016
sephe [Fri, 22 Apr 2016 05:01:43 +0000 (05:01 +0000)]
hyperv: Update copyright to 2016 for the files Microsoft changed in 2016

Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6039

8 years agoUse macro MAX() from sys/param.h.
araujo [Fri, 22 Apr 2016 03:55:33 +0000 (03:55 +0000)]
Use macro MAX() from sys/param.h.

MFC after: 2 weeks.

8 years agoUse MIN() macro from sys/param.h.
araujo [Fri, 22 Apr 2016 03:46:57 +0000 (03:46 +0000)]
Use MIN() macro from sys/param.h.

MFC after: 2 weeks.

8 years agoUse macro MAX() from sys/param.h.
araujo [Fri, 22 Apr 2016 03:43:06 +0000 (03:43 +0000)]
Use macro MAX() from sys/param.h.

MFC after: 2 weeks.

8 years agoUse macro MAX() from sys/param.h.
araujo [Fri, 22 Apr 2016 03:37:27 +0000 (03:37 +0000)]
Use macro MAX() from sys/param.h.

MFC after: 2 weeks.

8 years agoUse macro MAX() from sys/param.h.
araujo [Fri, 22 Apr 2016 03:32:14 +0000 (03:32 +0000)]
Use macro MAX() from sys/param.h.

MFC after: 2 weeks.

8 years agokernel: use our nitems() macro when it is available through param.h.
pfg [Thu, 21 Apr 2016 21:30:51 +0000 (21:30 +0000)]
kernel: use our nitems() macro when it is available through param.h.

No functional change, only trivial cases are done in this sweep,

Discussed in: freebsd-current

8 years agoDRY on buffer sizes. Update to r298420.
asomers [Thu, 21 Apr 2016 21:13:41 +0000 (21:13 +0000)]
DRY on buffer sizes.  Update to r298420.

sys/geom/geom_disk.c:
In disk_attr_changed, don't repeat a buffer size.

Reported by: ngie, hselasky
MFC after: 4 weeks
X-MFC-With: 298420
Sponsored by: Spectra Logic Corp

8 years agoPull r266775 from upstream clang trunk (by Douglas Katzman):
dim [Thu, 21 Apr 2016 20:38:10 +0000 (20:38 +0000)]
Pull r266775 from upstream clang trunk (by Douglas Katzman):

  Pass dwarf-version to cc1as.

  Fix PR26999 - crashing in cc1as with any '*bsd' target.

This should fix possible crashes when using -g in combination with
-save-temps.

8 years agoRevert r298147 (temporary workaround for LLVM PR 26999) in preparation
dim [Thu, 21 Apr 2016 20:37:53 +0000 (20:37 +0000)]
Revert r298147 (temporary workaround for LLVM PR 26999) in preparation
for committing the final upstream fix.

8 years agourtwn: optimize rate lookup in the urtwn_ra_init()
avos [Thu, 21 Apr 2016 20:34:38 +0000 (20:34 +0000)]
urtwn: optimize rate lookup in the urtwn_ra_init()

Replace loop with switch statement (rate2ridx())
(should be noop).

Tested with RTL8188EU / RTL8188CUS, STA mode.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D4848 (rebased)

8 years agoYet more redundant parenthesis from r298431.
pfg [Thu, 21 Apr 2016 20:30:38 +0000 (20:30 +0000)]
Yet more redundant parenthesis from r298431.

Mea culpa.

8 years agoCompletely disable fmaxmin_test (follow up to r297952)
ngie [Thu, 21 Apr 2016 19:59:55 +0000 (19:59 +0000)]
Completely disable fmaxmin_test (follow up to r297952)

COMPILER_TYPE/COMPILER_VERSION doesn't get passed down properly at
buildworld/installworld with older build hosts

MFC after: never
PR: 208703, 208963
Reported by: Jenkins
Sponsored by: EMC / Isilon Storage Division

8 years agosys: use our roundup2/rounddown2() macros when param.h is available.
pfg [Thu, 21 Apr 2016 19:57:40 +0000 (19:57 +0000)]
sys: use our roundup2/rounddown2() macros when param.h is available.

rounddown2 tends to produce longer lines than the original code
and when the code has a high indentation level it was not really
advantageous to do the replacement.

This tries to strike a balance between readability using the macros
and flexibility of having the expressions, so not everything is
converted.

8 years agoRedundant parenthesis from r298431.
pfg [Thu, 21 Apr 2016 19:48:28 +0000 (19:48 +0000)]
Redundant parenthesis from r298431.

8 years agosys: use our nitems() macro when param.h is available.
pfg [Thu, 21 Apr 2016 19:40:10 +0000 (19:40 +0000)]
sys: use our nitems() macro when param.h is available.

This should cover all the remaining cases in the kernel.

Discussed in: freebsd-current

8 years agoUse proper type of tag in bcm2835_mbox_fb_init
gonzo [Thu, 21 Apr 2016 18:58:06 +0000 (18:58 +0000)]
Use proper type of tag in bcm2835_mbox_fb_init

bcm2835_mbox_fb_init sets configuration so SET_VIRTUAL_OFFSET should be used
instead of GET_VIRTUAL_OFFSET

Submitted by: Sylvain Garrigues <sylvain@sylvaingarrigues.com>

8 years agoAdjust the fdc worker thread startup to work when APs are started earlier.
jhb [Thu, 21 Apr 2016 18:37:36 +0000 (18:37 +0000)]
Adjust the fdc worker thread startup to work when APs are started earlier.

- Enable the commented out locking in fd_probe().  The worker thread
  should not be running yet (even after these changes), but better to be
  safe than sorry.
- Defer starting the worker thread until after the child drives have been
  probed.  The worker thread startup is moved into a fdc_start_worker()
  thread that the various front ends call at the end of attach.  As a
  side effect this fixes a few edge cases that weren't shutting down the
  worker thread if attach encountered a late failure.
- When executing the initial reset requested by attach in the worker
  thread, use DELAY() instead of a tsleep() if cold is set.

Tested by: Howard Su <howard0su@gmail.com>
Sponsored by: Netflix

8 years agoQueue the CPU-probing task after all acpi_cpu devices are attached.
jhb [Thu, 21 Apr 2016 18:27:05 +0000 (18:27 +0000)]
Queue the CPU-probing task after all acpi_cpu devices are attached.

Eventually with earlier AP startup this code will change to call the
startup function synchronously instead of queueing the task.  Moving
the time we queue the task should be a no-op since taskqueue threads
don't start executing tasks until much later, but this reduces the diff
with the earlier AP startup patches.

Sponsored by: Netflix

8 years agoAdd new USB quirk.
hselasky [Thu, 21 Apr 2016 17:45:37 +0000 (17:45 +0000)]
Add new USB quirk.

Submitted by: Naram Qashat <cyberbotx@cyberbotx.com>
PR: 208642
MFC after: 1 week

8 years agoFix unset variables from r298417.
bdrewery [Thu, 21 Apr 2016 16:50:45 +0000 (16:50 +0000)]
Fix unset variables from r298417.

Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division

8 years agoReplace the A20 kernel config with a generic ALLWINNER kernel config that
jmcneill [Thu, 21 Apr 2016 16:49:04 +0000 (16:49 +0000)]
Replace the A20 kernel config with a generic ALLWINNER kernel config that
supports A20, A31, and A31S. Adds support for the BananaPi M2 (A31S) board.

Submitted by: Emmanuel Vadot <manu@bidouilliste.com>
Reviewed by: jmcneill
Differential Revision: https://reviews.freebsd.org/D5580

8 years agoAdd more missing .PHONY
bdrewery [Thu, 21 Apr 2016 16:43:36 +0000 (16:43 +0000)]
Add more missing .PHONY

Sponsored by: EMC / Isilon Storage Division

8 years agoNotify userspace listeners when geom disk attributes have changed
asomers [Thu, 21 Apr 2016 16:43:15 +0000 (16:43 +0000)]
Notify userspace listeners when geom disk attributes have changed

sys/geom/geom_disk.c:
disk_attr_changed(): Generate a devctl event of type GEOM:<attr> for
every call.

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

8 years agoFix for using IPv6 addresses with RDMA:
hselasky [Thu, 21 Apr 2016 16:33:42 +0000 (16:33 +0000)]
Fix for using IPv6 addresses with RDMA:

IPv6 addresses has a scope ID which sometimes is stored in the
"sin6_scope_id" field of "struct sockaddr_in6" and sometimes as part
of the IPv6 address itself depending on the context. If the scope ID
is not in the expected location, the IPv6 address lookups in the
so-called GID table will fail. Some code factoring has been made to
achieve a clean exit of the "addr_resolve" function via a common
"done" label.

Sponsored by: Mellanox Technologies
Submitted by: Shani Michaeli <shanim@mellanox.com>
MFC after: 1 week

8 years agoAdd more guards to disable GELIBOOT by defining LOADER_NO_GELI_SUPPORT
allanjude [Thu, 21 Apr 2016 16:32:48 +0000 (16:32 +0000)]
Add more guards to disable GELIBOOT by defining LOADER_NO_GELI_SUPPORT

Reviewed by: cem
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D6049

8 years agoRemove redundant logic from the pkg-base merge.
bdrewery [Thu, 21 Apr 2016 16:30:28 +0000 (16:30 +0000)]
Remove redundant logic from the pkg-base merge.

These will be set from the logic right above it.

Reviewed by: gjb
Sponsored by: EMC / Isilon Storage Division

8 years agoFix 'make -n' for new packaging targets.
bdrewery [Thu, 21 Apr 2016 16:30:25 +0000 (16:30 +0000)]
Fix 'make -n' for new packaging targets.

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd more missing .PHONY.
bdrewery [Thu, 21 Apr 2016 16:30:16 +0000 (16:30 +0000)]
Add more missing .PHONY.

This also protects them from trying to create .meta files
with WITH_META_MODE.

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Sponsored by: EMC / Isilon Storage Division

8 years agoGet rid of rctl_lock; use racct_lock where appropriate. The fast paths
trasz [Thu, 21 Apr 2016 16:22:52 +0000 (16:22 +0000)]
Get rid of rctl_lock; use racct_lock where appropriate. The fast paths
already required both of them, so having a separate rctl_lock didn't
buy us anything.

Reviewed by: mjg@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5914

8 years agoFollow-up r298219: Don't error with 'make all install'.
bdrewery [Thu, 21 Apr 2016 16:12:55 +0000 (16:12 +0000)]
Follow-up r298219: Don't error with 'make all install'.

Reported by: kib
Sponsored by: EMC / Isilon Storage Division

8 years agoFix for resolving mac address when the destination address is a gateway.
hselasky [Thu, 21 Apr 2016 16:04:58 +0000 (16:04 +0000)]
Fix for resolving mac address when the destination address is a gateway.
Remove some dead code while at it.

Sponsored by: Mellanox Technologies
MFC after: 1 week

8 years agoRemove slightly used const values that can be replaced with nitems().
pfg [Thu, 21 Apr 2016 15:38:28 +0000 (15:38 +0000)]
Remove slightly used const values that can be replaced with nitems().

Suggested by: jhb

8 years agosiba(4): remove slightly used 'bound' variable.
pfg [Thu, 21 Apr 2016 15:24:21 +0000 (15:24 +0000)]
siba(4): remove slightly used 'bound' variable.

It can be replaced with nitems(). While here simplify the function

Suggested by: jhb

8 years agoPrevent underflows in tp->snd_wnd if the remote side ACKs more than
jtl [Thu, 21 Apr 2016 15:06:53 +0000 (15:06 +0000)]
Prevent underflows in tp->snd_wnd if the remote side ACKs more than
tp->snd_wnd. This can happen, for example, when the remote side responds to
a window probe by ACKing the one byte it contains.

Differential Revision: https://reviews.freebsd.org/D5625
Reviewed by: hiren
Obtained from: Juniper Networks (earlier version)
MFC after: 2 weeks
Sponsored by: Juniper Networks

8 years agoDocument r296417, clang, llvm, etc. updated to upstream 3.8.0
skreuzer [Thu, 21 Apr 2016 14:20:45 +0000 (14:20 +0000)]
Document r296417, clang, llvm, etc. updated to upstream 3.8.0

Approved by: gjb@
Differential Revision: D6037

8 years agoMake the GIC SGI global variables static, they are only ever used within
andrew [Thu, 21 Apr 2016 14:04:56 +0000 (14:04 +0000)]
Make the GIC SGI global variables static, they are only ever used within
within this file.

Approved by: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoAdjust BOOTSTRAPPING test after MFC of kbdcontrol's -P option
emaste [Thu, 21 Apr 2016 13:14:55 +0000 (13:14 +0000)]
Adjust BOOTSTRAPPING test after MFC of kbdcontrol's -P option

8 years agoelftoolchain: Use ${SRCTOP} for the top of the FreeBSD tree
emaste [Thu, 21 Apr 2016 12:58:29 +0000 (12:58 +0000)]
elftoolchain: Use ${SRCTOP} for the top of the FreeBSD tree

It's provided by sys.mk so there's no need to derive it from ${.CURDIR}.

Suggested by: ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5998

8 years agoProperly setup arguments for if_resolvemulti() callback.
hselasky [Thu, 21 Apr 2016 11:32:22 +0000 (11:32 +0000)]
Properly setup arguments for if_resolvemulti() callback.

Sponsored by: Mellanox Technologies
MFC after: 1 week

8 years agoRemove stale function declaration
ae [Thu, 21 Apr 2016 11:02:06 +0000 (11:02 +0000)]
Remove stale function declaration

8 years agoConstify mbuf pointer for IPSEC functions where mbuf isn't modified.
ae [Thu, 21 Apr 2016 10:58:07 +0000 (10:58 +0000)]
Constify mbuf pointer for IPSEC functions where mbuf isn't modified.

8 years agoRework Mediatek/Ralink configuration files
sgalabov [Thu, 21 Apr 2016 07:40:03 +0000 (07:40 +0000)]
Rework Mediatek/Ralink configuration files

Only compile what each SoC needs and get rid of MEDIATEK generic config.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5996

8 years agoRestore the original ascii.c from prior to r290494
bapt [Thu, 21 Apr 2016 07:36:11 +0000 (07:36 +0000)]
Restore the original ascii.c from prior to r290494

It was doing the right thing, there was no need to "fail" to reinvent it from
none.c

Pointy hat: bapt
Submitted by: ache

8 years agoRestore histrory messed up in r290620
bapt [Thu, 21 Apr 2016 06:27:06 +0000 (06:27 +0000)]
Restore histrory messed up in r290620

ascii.c was removed during r290494 but this introduced an issue with ASCII that
has been fixed in r290618 and lead to a rewrite of ascii.c based on none.c.

ascii.c was wrongly reintroduced in r290620 without proper svn operation which
lost the history.

Reported by: ache, danfe

8 years agoUse MIN()/MAX() macros from sys/param.h.
araujo [Thu, 21 Apr 2016 06:24:13 +0000 (06:24 +0000)]
Use MIN()/MAX() macros from sys/param.h.

MFC after: 2 weeks.

8 years agoUse MAX() from sys/param.h.
araujo [Thu, 21 Apr 2016 06:21:33 +0000 (06:21 +0000)]
Use MAX() from sys/param.h.

MFC after: 2 weeks.

8 years agonet80211: refresh comments for ieee80211_scan_next() and
avos [Thu, 21 Apr 2016 06:19:33 +0000 (06:19 +0000)]
net80211: refresh comments for ieee80211_scan_next() and
ieee80211_scan_done().

Refresh comments that reference scan_next() method
(does not exist since r191746) + fix spelling of 'current'.

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

8 years agoFix a missing blank space.
araujo [Thu, 21 Apr 2016 06:14:30 +0000 (06:14 +0000)]
Fix a missing blank space.

8 years agoSimplify the get_type() function.
araujo [Thu, 21 Apr 2016 06:11:24 +0000 (06:11 +0000)]
Simplify the get_type() function.

Submitted by: bde
Discussed with: bde, jhb and pfg
MFC after: 2 weeks.

8 years agonet80211: enable promiscuous mode state change for non-monitor/ahdemo modes
avos [Thu, 21 Apr 2016 05:47:47 +0000 (05:47 +0000)]
net80211: enable promiscuous mode state change for non-monitor/ahdemo modes

- Allow to enable/disable promiscuous mode when:
  * interface is not a member of bridge, or;
  * request was issued by user (ifconfig wlan0 promisc), or;
  * interface is in MONITOR or AHDEMO mode.
- Drop local workarounds in mwl(4) and malo(4).

Tested with:
- Intel 3945BG, STA mode;
- RTL8188CUS, MONITOR mode;

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D5472

8 years agoBring a little more compability with GNU units 2.12
eadler [Thu, 21 Apr 2016 05:24:47 +0000 (05:24 +0000)]
Bring a little more compability with GNU units 2.12
- notionally support a 'history file' flag. This doesn't do much now,
  but is there to prevent scripts written against GNU units from
  breaking
- correctly gracefully quit rather than exit (this will make it easier
  to support a history file in the future)
- remove the "t" flag from fopen which was there to support windows. We
  have not supported windows since at the latest, the introduction of
  capsicum.

8 years agoRemove project.name which is a product of a bygone era.
eadler [Thu, 21 Apr 2016 04:33:07 +0000 (04:33 +0000)]
Remove project.name which is a product of a bygone era.

8 years agoAdd the address at which the routine returned.
gnn [Thu, 21 Apr 2016 03:17:53 +0000 (03:17 +0000)]
Add the address at which the routine returned.

MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)

8 years agodhclient: Log a warning instead of bailing upon "illegal" options
sephe [Wed, 20 Apr 2016 23:56:25 +0000 (23:56 +0000)]
dhclient: Log a warning instead of bailing upon "illegal" options

In Azure, the DHCP servers add private option (id 0xf5), which contains
binary form of an IPv4 address. Once this option is converted to string
form, it could contain '$', e.g.

IPv4 address: 100.72.36.54
binary form: 0x64 0x48 0x24 0x36
string form: "dH$6"

dhclient bails upon "illegal" options like the above example, thus the
VM bring-up will fail.

Also as a side note, this "illegal" option detection was added in
OpenBSD ~11years ago:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.50&content-type=text/x-cvsweb-markup

And it was removed along with the removal of script support in OpenBSD
~3years ago:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.159&content-type=text/x-cvsweb-markup

Reported by: Hongxiong Xian <v-hoxian microsoft com>
Reviewed by: jhb, Dexuan Cui <decui microsoft com>
Tested by: Hongxiong Xian <v-hoxian microsoft com>
Analyzed by: Dong Liu <doliu microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5853

8 years agoRevert r298357
wma [Wed, 20 Apr 2016 22:41:19 +0000 (22:41 +0000)]
Revert r298357

Revert workaround fixed by r298361

8 years agoForce framebuffer virtual viewport to be the same as physical
gonzo [Wed, 20 Apr 2016 22:38:00 +0000 (22:38 +0000)]
Force framebuffer virtual viewport to be the same as physical

VideoCore reports garbage in viewport geometry fields unless
viewport was set previously by earlier stage boot loader. So
when booting FreeBSD kernel directly from VideoCore's start.elf
framebuffer intialization fails due to invalid vxres, vyres
values. Make sure we request viewport to be equal to physical
resolution

Submitted by: Sylvain Garrigues <sylvain@sylvaingarrigues.com>

8 years agoPlug memory leak
bapt [Wed, 20 Apr 2016 21:37:32 +0000 (21:37 +0000)]
Plug memory leak

Reported by: coverity
CID: 13316641331665

8 years agoPlug various resources leak
bapt [Wed, 20 Apr 2016 21:32:34 +0000 (21:32 +0000)]
Plug various resources leak
While here fix a test logic

Reported by: coverity
CID: 1332096133209713320981332099133210013321011332102
MFC after: 1 week

8 years agoPrefer sizeof(*pointer) over sizeof(type). No funtional change.
jkim [Wed, 20 Apr 2016 21:30:56 +0000 (21:30 +0000)]
Prefer sizeof(*pointer) over sizeof(type).  No funtional change.

8 years agoThere is no need to use array any more. No functional change.
jkim [Wed, 20 Apr 2016 21:26:59 +0000 (21:26 +0000)]
There is no need to use array any more.  No functional change.

8 years agoPlug memory leaks
bapt [Wed, 20 Apr 2016 21:23:42 +0000 (21:23 +0000)]
Plug memory leaks

Reported by: Coverity
CID= 13385351338536133854213385691338570

8 years agoRemove query flag from acpi_EvaluateOSC(). This function does not support
jkim [Wed, 20 Apr 2016 21:21:47 +0000 (21:21 +0000)]
Remove query flag from acpi_EvaluateOSC().  This function does not support
return buffer (yet).

8 years agonet80211: hide subtype mask & shift in function call.
avos [Wed, 20 Apr 2016 21:15:55 +0000 (21:15 +0000)]
net80211: hide subtype mask & shift in function call.

Hide subtype mask/shift (which is used for index calculation
in ieee80211_mgt_subtype_name[] array) in function call.

Tested with RTL8188CUS, STA mode.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D5369

8 years agoRemove unused SMB_DIALECT_MAX macro.
pfg [Wed, 20 Apr 2016 21:13:24 +0000 (21:13 +0000)]
Remove unused SMB_DIALECT_MAX macro.

Found by: jhb

8 years agoPlug leaks
bapt [Wed, 20 Apr 2016 21:11:49 +0000 (21:11 +0000)]
Plug leaks

Reported by: Coverity
CID: 1340155 and 1340156
MFC after: 1 week

8 years agoAdd more fields from struct ifnet needed during debugging a kernel panic.
bz [Wed, 20 Apr 2016 21:04:39 +0000 (21:04 +0000)]
Add more fields from struct ifnet needed during debugging a kernel panic.
Move if_fib into the right place.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

8 years agoInvoke _OSC on Host-PCI bridges.
jhb [Wed, 20 Apr 2016 20:58:30 +0000 (20:58 +0000)]
Invoke _OSC on Host-PCI bridges.

Tell the firmware that we support PCI-express config space access
and MSI.

Reviewed by: jkim
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6023

8 years agoFix bad checking of the return of realloc(3)
bapt [Wed, 20 Apr 2016 20:56:06 +0000 (20:56 +0000)]
Fix bad checking of the return of realloc(3)

Reported by: Coverity
CID: 1007335
MFC after: 3 days

8 years agoAdd a wrapper for evaluating _OSC methods.
jhb [Wed, 20 Apr 2016 20:55:58 +0000 (20:55 +0000)]
Add a wrapper for evaluating _OSC methods.

This wrapper does not translate errors in the first word to ACPI
error status returns.  Use this wrapper in the acpi_cpu(4) driver in
place of the existing _OSC code.  While here, fix a bug where the wrong
count of words was passed when invoking _OSC.

Reviewed by: jkim
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6022

8 years agoFix typo: actually test the return of strchr(3)
bapt [Wed, 20 Apr 2016 20:54:47 +0000 (20:54 +0000)]
Fix typo: actually test the return of strchr(3)

Reported by: Coverity
CID: 1007335
MFC after: 3 days

8 years agoFix coverity issue with contrib/netbsd-tests/lib/libc/ssp/h_read.c
ngie [Wed, 20 Apr 2016 20:48:54 +0000 (20:48 +0000)]
Fix coverity issue with contrib/netbsd-tests/lib/libc/ssp/h_read.c

Ensure opening /dev/zero succeeds. Abort the test if it doesn't.

Also, use _PATH_DEVZERO instead of hardcoding "/dev/zero"

MFC after: 2 weeks
CID: 1251410
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division"

8 years agoCheck the returned value of memchr(3) before using it
bapt [Wed, 20 Apr 2016 20:44:30 +0000 (20:44 +0000)]
Check the returned value of memchr(3) before using it

Reported by: Coverity
CID: 1338530