]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoRemove a variable and three lines of code which I should have removed as
gad [Mon, 25 Apr 2016 20:58:54 +0000 (20:58 +0000)]
Remove a variable and three lines of code which I should have removed as
part of revision 98776 back on June 24/2002.  Noticed by pfg@ trying
coccinelle for checking code.

MFC after: 3 weeks

8 years ago1. Removed -Wno-shift-negative-value from Makefile
davidcs [Mon, 25 Apr 2016 18:55:01 +0000 (18:55 +0000)]
1. Removed -Wno-shift-negative-value from Makefile
2. Fixed warning its absence caused in bxe_elink.c

MFC after:5 days

8 years agoIncrease DTRACE_FUNCNAMELEN from 128 to 192.
markj [Mon, 25 Apr 2016 18:44:11 +0000 (18:44 +0000)]
Increase DTRACE_FUNCNAMELEN from 128 to 192.

This allows for the long function components encountered in www/firefox.
This constant is part of DTrace's userland ABI, so this change may not be
MFC'ed.

PR: 207735

8 years agoAllow DOF sections with excessively long probe function components.
markj [Mon, 25 Apr 2016 18:40:57 +0000 (18:40 +0000)]
Allow DOF sections with excessively long probe function components.

Without this change, DTrace will refuse to load a DOF section if the
function component of any of its probes exceeds DTRACE_FUNCNAMELEN (128).
Probes in C++ programs can have very long function components. Rather than
rejecting all probes if a single probe exceeds the limit, simply skip the
invalid probe and emit a warning. This ensures that valid probes are
instantiated.

PR: 207735
MFC after: 2 weeks

8 years agoAdd a kern.dtrace.err_verbose sysctl to control dtrace_err_verbose.
markj [Mon, 25 Apr 2016 18:09:36 +0000 (18:09 +0000)]
Add a kern.dtrace.err_verbose sysctl to control dtrace_err_verbose.

When this flag is turned on, DOF and DIF validation errors are printed to
the kernel message buffer. This is useful for debugging.

Also remove the debug.dtrace.debug sysctl, which has no effect.

8 years agoUse the yield instruction in the arm64 cpu_spinwait. This instruction is
andrew [Mon, 25 Apr 2016 17:32:08 +0000 (17:32 +0000)]
Use the yield instruction in the arm64 cpu_spinwait. This instruction is
a hint to the hardware the software is not performing a task.

Sponsored by: ABT Systems Ltd

8 years agoEncapsulate SYSV IPC objects in jails. Define per-module parameters
jamie [Mon, 25 Apr 2016 17:06:50 +0000 (17:06 +0000)]
Encapsulate SYSV IPC objects in jails.  Define per-module parameters
sysvmsg, sysvsem, and sysvshm, with the following bahavior:

inherit: allow full access to the IPC primitives.  This is the same as
the current setup with allow.sysvipc is on.  Jails and the base system
can see (and moduly) each other's objects, which is generally considered
a bad thing (though may be useful in some circumstances).

disable: all no access, same as the current setup with allow.sysvipc off.

new: A jail may see use the IPC objects that it has created.  It also
gets its own IPC key namespace, so different jails may have their own
objects using the same key value.  The parent jail (or base system) can
see the jail's IPC objects, but not its keys.

PR: 48471
Submitted by: based on work by kikuchan98@gmail.com
MFC after: 5 days

8 years agoNote the existence of module-specific jail paramters, starting with the
jamie [Mon, 25 Apr 2016 17:01:13 +0000 (17:01 +0000)]
Note the existence of module-specific jail paramters, starting with the
linux.* parameters when linux emulation is loaded.

MFC after: 5 days

8 years ago[bhnd] Fix ChipCommon probing.
adrian [Mon, 25 Apr 2016 16:53:13 +0000 (16:53 +0000)]
[bhnd] Fix ChipCommon probing.

ChipCommon probing uses mapping table "chipc_devices". It calls bhnd_device_lookup,
which iterate over mapping table with end condition:

entry->desc != NULL

So if mapping table contains row with description equals to NULL, it will
stop processing of mapping. I.e. description is mandatory field and should
be not NULL.

This patch corrects mapping table for ChipCommon.

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

8 years ago[iwn] fix firmware command use in iwm_auth().
adrian [Mon, 25 Apr 2016 16:13:04 +0000 (16:13 +0000)]
[iwn] fix firmware command use in iwm_auth().

The iwm firmware has separate commands for add, modify and delete for
various things (mac, phy context, etc.)  The openbsd driver has a habit
of just completely resetting the NIC each time, which is technically
mostly okay (as long as the reset doesn't actually fail!) but it means
a lot of the code is doing ADD when it should do MODIFY.

The firmware responds in kind - it just asserts.

This fixes auth attempts that occur after the NIC has been already
configured.

(I'm sure there are more instances of this!)

Tested:

iwm0: <Intel Dual Band Wireless AC 7260> mem 0xf1400000-0xf1401fff irq 17 at device 0.0 on pci2
iwm0: revision: 0x140, firmware 25.228 (API ver. 9)

.. STA mode.

Submitted by: Masachika ISHIZUKA <ish@amail.plala.or.jp>

8 years agoExample RIPE whois query with options and spaces.
fanf [Mon, 25 Apr 2016 15:46:42 +0000 (15:46 +0000)]
Example RIPE whois query with options and spaces.

Since it is used in the example, mention the -- option in the synopsis
even though it is a universal standard, and tweak to fit it on one line.

8 years agoo Implement shared pagetables and switch from 4 to 3 levels page
br [Mon, 25 Apr 2016 14:47:51 +0000 (14:47 +0000)]
o Implement shared pagetables and switch from 4 to 3 levels page
memory system.

RISC-V ISA has only single page table base register for both kernel
and user addresses translation. Before this commit we were using an
extra (4th) level of pagetables for switching between kernel and user
pagetables, but then realized FPGA hardware has 3-level page system
hardcoded. It is also become clear that the bitfile synthesized for
4-level system is untested/broken, so we can't use extra level for
switching.

We are now share level 1 of pagetables between kernel and user VA.
This requires to keep track of all the user pmaps created and once we
adding L1 page to kernel pmap we have to add it to all the user pmaps.

o Change the VM layout as we must have topmost bit to be 1 in the
  selected page system for kernel addresses and 0 for user addresses.
o Implement pmap_kenter_device().
o Create the l3 tables for the early devmap.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoDo not setup machine exception vector.
br [Mon, 25 Apr 2016 13:30:37 +0000 (13:30 +0000)]
Do not setup machine exception vector.

Sounds strange, but both RocketCore and lowRISC do not operate
if we set it.

All the known implementations (Spike, QEMU, RocketCore, lowRISC) uses
default machine trap vector address and operates fine with this.

Original Berkeley Boot Loader (bbl) does not set this as well.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoRevert r298477 ("Clear the DDR memory").
br [Mon, 25 Apr 2016 13:20:57 +0000 (13:20 +0000)]
Revert r298477 ("Clear the DDR memory").

There is no need to clear all the DDR memory (we only need to clear
BSS section).
I was playing with non-default version of hardware (the bitfile
synthesized for 4-level page memory system) and clearing was helpful,
but then realized support for 4-level page system is untested/broken
in both RocketCore and lowRISC.

8 years agoTry to make gcc builds happy again by removing a redundant declaration.
bz [Mon, 25 Apr 2016 13:20:35 +0000 (13:20 +0000)]
Try to make gcc builds happy again by removing a redundant declaration.

8 years agohyperv/hn: Synchronize sub-channel offers
sephe [Mon, 25 Apr 2016 10:16:07 +0000 (10:16 +0000)]
hyperv/hn: Synchronize sub-channel offers

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv/channel: Add functions to synchronize sub-channel offers
sephe [Mon, 25 Apr 2016 09:00:06 +0000 (09:00 +0000)]
hyperv/channel: Add functions to synchronize sub-channel offers

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agolinux_map_osrel doesn't need to be checked in linux_prison_set,
jamie [Mon, 25 Apr 2016 06:08:45 +0000 (06:08 +0000)]
linux_map_osrel doesn't need to be checked in linux_prison_set,
since it already was in linux_prison_check.

8 years agohyperv/channel: Log a warning about duplicated primary channel offer
sephe [Mon, 25 Apr 2016 05:58:32 +0000 (05:58 +0000)]
hyperv/channel: Log a warning about duplicated primary channel offer

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv/channel: Remove unapplied comment
sephe [Mon, 25 Apr 2016 05:46:44 +0000 (05:46 +0000)]
hyperv/channel: Remove unapplied comment

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv/channel: Minor style changes; no functional changes.
sephe [Mon, 25 Apr 2016 05:30:42 +0000 (05:30 +0000)]
hyperv/channel: Minor style changes; no functional changes.

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv/channel: Remove the unnecessary 'new' flag
sephe [Mon, 25 Apr 2016 05:22:35 +0000 (05:22 +0000)]
hyperv/channel: Remove the unnecessary 'new' flag

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv/et: Strip extra white space in function name
sephe [Mon, 25 Apr 2016 04:58:14 +0000 (04:58 +0000)]
hyperv/et: Strip extra white space in function name

Reported by: Sascha Wildner <saw online de>
MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agoUse the new PR_METHOD_REMOVE to clean up jail handling in POSIX
jamie [Mon, 25 Apr 2016 04:36:54 +0000 (04:36 +0000)]
Use the new PR_METHOD_REMOVE to clean up jail handling in POSIX
message queues.

8 years agoPass the current/new jail to PR_METHOD_CHECK, which pushes the call
jamie [Mon, 25 Apr 2016 04:27:58 +0000 (04:27 +0000)]
Pass the current/new jail to PR_METHOD_CHECK, which pushes the call
until after the jail is found or created.  This requires unlocking the
jail for the call and re-locking it afterward, but that works because
nothing in the jail has been changed yet, and other processes won't
change the important fields as long as allprison_lock remains held.

Keep better track of name vs namelc in kern_jail_set.  Name should
always be the hierarchical name (relative to the caller), and namelc
the last component.

PR: 48471
MFC after: 5 days

8 years agoAdd a new jail OSD method, PR_METHOD_REMOVE. It's called when a jail is
jamie [Mon, 25 Apr 2016 04:24:00 +0000 (04:24 +0000)]
Add a new jail OSD method, PR_METHOD_REMOVE.  It's called when a jail is
removed from the user perspective, i.e. when the last pr_uref goes away,
even though the jail mail still exist in the dying state.  It will also
be called if either PR_METHOD_CREATE or PR_METHOD_SET fail.

PR: 48471
MFC after:  5 days

8 years agoRemove the PR_REMOVE flag, which was meant as a temporary marker for
jamie [Mon, 25 Apr 2016 03:58:08 +0000 (03:58 +0000)]
Remove the PR_REMOVE flag, which was meant as a temporary marker for
a jail that might be seen mid-removal.  It hasn't been doing the right
thing since at least the ability to resurrect dying jails, and such
resurrection also makes it unnecessary.

8 years agohyperv/hn: Allow users to configure ifq or bufring depth.
sephe [Mon, 25 Apr 2016 03:48:28 +0000 (03:48 +0000)]
hyperv/hn: Allow users to configure ifq or bufring depth.

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agoMake jail(8) interpret escape codes in fstab the same as getfsent(3).
jamie [Mon, 25 Apr 2016 03:24:48 +0000 (03:24 +0000)]
Make jail(8) interpret escape codes in fstab the same as getfsent(3).

PR: 208663
MFC after: 3 days

8 years agohn: Increase odrops for if_transmit method if drbr_enqueue fails.
sephe [Mon, 25 Apr 2016 03:14:55 +0000 (03:14 +0000)]
hn: Increase odrops for if_transmit method if drbr_enqueue fails.

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agoOR in the unsigned form of the MCAR lower register.
jhibbits [Mon, 25 Apr 2016 03:01:57 +0000 (03:01 +0000)]
OR in the unsigned form of the MCAR lower register.

When ORing in a register_t to a wider integer (vm_paddr_t), it gets sign
extended, so high addresses overwrite the upper word with all 0xf.  Cast to the
unsigned form (u_register_t), to avoid this problem, and get correct addresses
printed.

8 years agoInit static compiled-in env when no metadata present.
jhibbits [Mon, 25 Apr 2016 00:55:51 +0000 (00:55 +0000)]
Init static compiled-in env when no metadata present.

With this, a static environment can be compiled in via config(5).  This allows,
among other things, the use of a compiled-in debug console (hw.uart.dbgport) for
kgdb.

8 years agoifconfig: prevent some improbable signed integer overflows.
pfg [Mon, 25 Apr 2016 00:41:23 +0000 (00:41 +0000)]
ifconfig: prevent some improbable signed integer overflows.

ic_nchans, from struct:ieee80211req_chaninfo, is an unsigned int.
Use an unsigned index to prevent overflowing the index.

Adopt unsigned integers in other cases where it is useful
to be aware of the unsigned quantities and there is no
risk of the values being negative.

MFC after: 1 week

8 years agoAMD64 pmap: Use howmany() macro
cem [Sun, 24 Apr 2016 21:35:01 +0000 (21:35 +0000)]
AMD64 pmap: Use howmany() macro

Use param.h howmany() instead of hand-rolled version.

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd myself (finally) to the port committer's dot file.
gordon [Sun, 24 Apr 2016 21:19:00 +0000 (21:19 +0000)]
Add myself (finally) to the port committer's dot file.

Approved by: mat (mentor)
Differential Revision: https://reviews.freebsd.org/D6074

8 years agofsck_ffs: Adopt some type safety for the journalling checks.
pfg [Sun, 24 Apr 2016 20:31:22 +0000 (20:31 +0000)]
fsck_ffs: Adopt some type safety for the journalling checks.

fs_ncg is of type uint32, and we were indexing it with an int.
Fixed this using an unsigned type and adopt some other unsigned
indexes to remind us when we are dealing with unsigned numbers.

Reviewed by: mckusick
MFC after: 5 days

8 years agoFix duplicate "name" variable that sneaked in with the rc description commit.
lme [Sun, 24 Apr 2016 19:25:11 +0000 (19:25 +0000)]
Fix duplicate "name" variable that sneaked in with the rc description commit.

Approved by: jhibbits

8 years agoFix build for NOINET and NOINET6 kernels.
ae [Sun, 24 Apr 2016 17:09:51 +0000 (17:09 +0000)]
Fix build for NOINET and NOINET6 kernels.

Use own protosw structures for both address families.
Check proto in encapcheck function and use -1 as proto argument in
encap_attach_func(), both address families can have IPPROTO_IPV4
and IPPROTO_IPV6 protocols.

Reported by: bz

8 years agoFix NOIP kernels to compile.
bz [Sun, 24 Apr 2016 15:56:05 +0000 (15:56 +0000)]
Fix NOIP kernels to compile.

8 years agoAdd myself as src commiter.
manu [Sun, 24 Apr 2016 14:49:01 +0000 (14:49 +0000)]
Add myself as src commiter.

Approved by: cognet (mentor)

8 years agoFix typo (forgotten "=" after desc).
se [Sun, 24 Apr 2016 12:07:44 +0000 (12:07 +0000)]
Fix typo (forgotten "=" after desc).

8 years agoMLINK mfi.4 to mfi_linux.4 and mfip.4 to cover these kernel modules.
brueffer [Sun, 24 Apr 2016 11:41:36 +0000 (11:41 +0000)]
MLINK mfi.4 to mfi_linux.4 and mfip.4 to cover these kernel modules.

The mfi(4) manpage doesn't explain the modules yet, but at least we direct
users to the right place.

PR: 205925
Submitted by: dvl
MFC after: 1 week
Sponsored by: Essen Hackathon 2016

8 years agoCosmetics: - no need to escape the newline after '|'
schweikh [Sun, 24 Apr 2016 10:52:59 +0000 (10:52 +0000)]
Cosmetics: - no need to escape the newline after '|'
           - parenthesize the "case" string for symmetry and improved
             search for matching paren (e.g. with vi's %)

8 years agoUse ipsec_address() function to print IP addresses.
ae [Sun, 24 Apr 2016 09:05:29 +0000 (09:05 +0000)]
Use ipsec_address() function to print IP addresses.

8 years agoHandle non-compressed packets for IPComp in tunnel mode.
ae [Sun, 24 Apr 2016 09:02:17 +0000 (09:02 +0000)]
Handle non-compressed packets for IPComp in tunnel mode.

RFC3173 says that the IP datagram MUST be sent in the original
non-compressed form, when the total size of a compressed payload
and the IPComp header is not smaller than the size of the original
payload. In tunnel mode for small packets IPComp will send
encapsulated IP datagrams without IPComp header.
Add ip_encap handler for IPPROTO_IPV4 and IPPROTO_IPV6 to handle
these datagrams. The handler does lookup for SA related to IPComp
protocol and given from mbuf source and destination addresses as
tunnel endpoints. It decapsulates packets only when corresponding SA
is found.

Reported by: gnn
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D6062

8 years agoCorrect types for g_example_start() and g_example_access().
brueffer [Sun, 24 Apr 2016 08:31:32 +0000 (08:31 +0000)]
Correct types for g_example_start() and g_example_access().

PR: 203498
Submitted by: chadf@triularity.org, ae
MFC after: 1 week
Sponsored by: Essen Hackathon 2016

8 years agoAdjust a type from r267490.
pfg [Sun, 24 Apr 2016 04:28:04 +0000 (04:28 +0000)]
Adjust a type from r267490.

Independent of the maximum length, the return type for strnlen(3)
is always size_t.

8 years agopatch(1): avoid signed integer overflow when debugging.
pfg [Sun, 24 Apr 2016 04:08:36 +0000 (04:08 +0000)]
patch(1): avoid signed integer overflow when debugging.

Integer i is used to index p_end of type LINENUM (actually long).

Match the types.

MFC after: 5 days

8 years agoZero the newly allocated spinlock.
jhibbits [Sun, 24 Apr 2016 01:38:45 +0000 (01:38 +0000)]
Zero the newly allocated spinlock.

Not sure how this worked testing with DIAGNOSTIC set, but with it disabled this
fails due to the spinlock being "initialized" with 0xdeadc0de.

8 years agoAdd a single example of adding a user that roughly corresponds with the
wblock [Sat, 23 Apr 2016 22:57:54 +0000 (22:57 +0000)]
Add a single example of adding a user that roughly corresponds with the
adduser example in the Handbook.

MFC after: 1 week

8 years agoDefine which of the username options (-u/-U) to jexec(8) is the default.
bcr [Sat, 23 Apr 2016 22:31:58 +0000 (22:31 +0000)]
Define which of the username options (-u/-U) to jexec(8) is the default.
Bump Dd.

PR: 207587
Submitted by: dewayne@heuristicsystems.com.au
MFC after: 3 days
Sponsored by: Essen Hackathon 2016

8 years agoAllow the NFSv4 server to reply NFSERR_WRONGSEC for the SetClientID operation.
rmacklem [Sat, 23 Apr 2016 21:18:45 +0000 (21:18 +0000)]
Allow the NFSv4 server to reply NFSERR_WRONGSEC for the SetClientID operation.

It was reported via email that a Linux client couldn't do a Kerberized
NFS mount when only "sec=krb5" was specified for the exports. The Linux
client attempted a mount via krb5i and the server replied NFSERR_SERVERFAULT.
Although NFSERR_WRONGSEC isn't listed as an error for SetClientID, I
think it is the correct reply, so this patch enables that.
I do not know if this fixes the mount attempt, but adding "krb5i" to the
list of allowed security flavours does allow the mount to work.

Reported by: joef@spectralogic.com
MFC after: 2 weeks

8 years agoThe default value of MINFREE is defined to be 8% in
bcr [Sat, 23 Apr 2016 20:45:52 +0000 (20:45 +0000)]
The default value of MINFREE is defined to be 8% in
ufs/ffs/fs.h and not 10%.  The newfs(8) and tunefs(8)
man pages had this change already, but fs(5) did not.
This change makes it consistent again.

Bump Dd.

PR:             204929
Submitted by:   amutu@amutu.com
MFC after:      3 days
Sponsored by:   Essen Linuxhotel Hackathon 2016

8 years agoregex: prevent two improbable signed integer overflows.
pfg [Sat, 23 Apr 2016 20:45:09 +0000 (20:45 +0000)]
regex: prevent two improbable signed integer overflows.

In matcher() we used an integer to index nsub of type size_t.
In print() we used an integer to index nstates of type sopno,
typedef'd long.
In both cases the indexes never take negative values.

Match the types to avoid any error.

MFC after: 5 days

8 years agoAllow to build svr4 module with SYSV support separatelly from the kernel build.
dchagin [Sat, 23 Apr 2016 20:31:18 +0000 (20:31 +0000)]
Allow to build svr4 module with SYSV support separatelly from the kernel build.

PR: 208464
Reported by: Kristoffer Eriksson
MFC after: 2 week

8 years agoFix streams and svr4 module dependency. Both modules are complaining about
dchagin [Sat, 23 Apr 2016 20:29:55 +0000 (20:29 +0000)]
Fix streams and svr4 module dependency. Both modules are complaining about
undefined symbol svr4_delete_socket which was moved from streams to the svr4 module
in r160558 that created a two-way dependency between them.

PR: 208464
Submitted by: Kristoffer Eriksson
Reported by: Kristoffer Eriksson
MFC after: 2 week

8 years agoext2_htree_release(): prevent signed integer overflow in a loop.
pfg [Sat, 23 Apr 2016 18:28:59 +0000 (18:28 +0000)]
ext2_htree_release(): prevent signed integer overflow in a loop.

h_levels_num, as most data structs in ext2fs, is unsigned so
the index that addresses it has to be unsigned as well.

To get to overflow here we would probably be considering a
degenerate case though.

MFC after: 5 days

8 years agoBump the date of the manpage after r298515
bapt [Sat, 23 Apr 2016 17:09:40 +0000 (17:09 +0000)]
Bump the date of the manpage after r298515

Sponsored by: Essen Hackathon 2016

8 years agoDon't remove the /var/run/jail_name.id file if a jail fails to start.
jamie [Sat, 23 Apr 2016 16:23:01 +0000 (16:23 +0000)]
Don't remove the /var/run/jail_name.id file if a jail fails to start.
This messes up ezjail (and possibly others), when attempting to start
a jail that already exists.

PR: 208806
Reviewed by: tj
MFC after: 5 days

8 years ago- Add two new subcommands to rc.subr:
lme [Sat, 23 Apr 2016 16:19:34 +0000 (16:19 +0000)]
- Add two new subcommands to rc.subr:
  "describe" shows an rc script's description
  "extracommands" shows an rc script's non-standard commands like "reload", "configtest", "keygen", etc
- Update the rc(8) manpage and the tcsh(1) completion examples to reflect these changes

Approved by: bapt
Sponsored by: Essen Linuxhotel Hackathon 2016
Differential Revision: D452

8 years ago- Add descriptions to most of the rc scripts. Those are mostly taken from their
lme [Sat, 23 Apr 2016 16:10:54 +0000 (16:10 +0000)]
- Add descriptions to most of the rc scripts. Those are mostly taken from their
  daemon's manpage and probably improved.
- Consistently use "filesystem" not "file system".

Approved by: bapt, brueffer
Differential Revision: D452

8 years agoAdd support for Allwinner A31/A31S R-GPIO (CPUs-PORT) controller.
jmcneill [Sat, 23 Apr 2016 13:59:18 +0000 (13:59 +0000)]
Add support for Allwinner A31/A31S R-GPIO (CPUs-PORT) controller.

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

8 years agoRemove mroute6d rc script
bapt [Sat, 23 Apr 2016 13:24:45 +0000 (13:24 +0000)]
Remove mroute6d rc script

It is directly available via ports (pim6dd which provides the needed rc script)

Reported by: lme
Sponsored by: Essen Hackathon 2016

8 years agoImprove upon r296618 to keep lines < 80 characters.
brueffer [Sat, 23 Apr 2016 11:04:45 +0000 (11:04 +0000)]
Improve upon r296618 to keep lines < 80 characters.

Pointed out by: jhb
Sponsored by: Essen Hackathon 2016

8 years agoRemove a function, which is not used anymore.
tuexen [Sat, 23 Apr 2016 09:15:58 +0000 (09:15 +0000)]
Remove a function, which is not used anymore.

8 years agoFix looking for "UTC" at start of ptr by using strnmp instead of improperly
ngie [Sat, 23 Apr 2016 08:10:04 +0000 (08:10 +0000)]
Fix looking for "UTC" at start of ptr by using strnmp instead of improperly
unrolled equivalent

CID: 1347118
MFC after: 1 week
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division

8 years agoGC duplicate define.
sobomax [Sat, 23 Apr 2016 07:28:32 +0000 (07:28 +0000)]
GC duplicate define.

8 years agoImprove performance in a few key areas:
sobomax [Sat, 23 Apr 2016 07:23:43 +0000 (07:23 +0000)]
Improve performance in a few key areas:

 o Split the compression across several worker threads. By default, "several"
   matches number of CPUs, capped at 24 for sanity when running on a very big
   hardwares. Provide option to set that number manually;

 o Fix bug inherited from the mkulzma (R.I.P) which degraded already slow LZMA
   compression even further by calling function to release compression state
   after processing each block.

   It is neither documented as required nor actually required by the LZMA
   library. This caused spree of system calls to release memory and then map
   it again for every block. LZMA compression is more than 2x faster after this
   change alone;

 o Record time it takes to do compression and report throughput achieved.

 o Add simple first-level 256 entry hash table for de-dup code, so it's not
   becoming a bottleneck at big files.

8 years agoo Fix handling of images with compression block sizes comparable to
sobomax [Sat, 23 Apr 2016 06:31:46 +0000 (06:31 +0000)]
o Fix handling of images with compression block sizes comparable to
  MAXPHYS.

o Improve debug somewhat;

o Convert "BUG BUG BUG message" into a proper KASSERT.

8 years agoRemove uart_dev_mtk_ns8250
sgalabov [Sat, 23 Apr 2016 04:27:01 +0000 (04:27 +0000)]
Remove uart_dev_mtk_ns8250

The purpose of this file was to simply detect the UART speed before
attaching the actual ns8250 driver so that we don't have to specify the
UART speed in DTS files.

However, OpenWRT DTS files specify ns16550a as a compatible string in
their DTS files and this makes the original ns8250 driver attach to
the device. So we would have to edit the DTS files anyway and since this
is only the case for MT7621 and MT7628/MT7688 for now, it's better to
just add the clock-frequency property to those (UART is always clocked
by the same clock in both these SoCs, so that's fine) instead of having
a separate driver and still having to change the DTS files.

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

8 years agoReduce the FreeBSD specific DTS files for Mediatek/Ralink
sgalabov [Sat, 23 Apr 2016 04:24:30 +0000 (04:24 +0000)]
Reduce the FreeBSD specific DTS files for Mediatek/Ralink

The introduction of palmbus and previous work allows us to cut the
differences between FreeBSD and OpenWRT DTS files a bit further.

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

8 years agoUse cpu_establish_hardintr in mtk_intr_gic
sgalabov [Sat, 23 Apr 2016 04:22:38 +0000 (04:22 +0000)]
Use cpu_establish_hardintr in mtk_intr_gic

This allows us to come closer to OpenWRT vanilla DTS files.

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

8 years agoIntroduce palmbus for Mediatek/Ralink SoCs
sgalabov [Sat, 23 Apr 2016 04:21:18 +0000 (04:21 +0000)]
Introduce palmbus for Mediatek/Ralink SoCs

This allows us to get closer to OpenWRT DTS files and minimize the diffs
a little more.

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

8 years agoMinor pinctrl fixes for Mediatek/Ralink
sgalabov [Sat, 23 Apr 2016 04:19:42 +0000 (04:19 +0000)]
Minor pinctrl fixes for Mediatek/Ralink

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

8 years agoRemove Unused/Dead Code
davidcs [Sat, 23 Apr 2016 01:22:12 +0000 (01:22 +0000)]
Remove Unused/Dead Code

MFC after:5 days

8 years agoFix a LOR in the NFSv4.1 server.
rmacklem [Sat, 23 Apr 2016 01:22:04 +0000 (01:22 +0000)]
Fix a LOR in the NFSv4.1 server.

The ordering of acquisition of the state and session mutexes was
reversed in two cases executed when an NFSv4.1 client created/freed
a session. Since clients will typically do this only when mounting
and dismounting, the likelyhood of causing a deadlock was low but possible.
This can only occur for NFSv4.1 mounts, since the others do not
use sessions.
This was detected while testing the pNFS server/client where the
client crashed during dismounting.
The patch also reorders the unlocks, although that isn't necessary
for correct operation.

MFC after: 2 weeks

8 years agoFix error when SRCCONF is empty.
bdrewery [Fri, 22 Apr 2016 20:31:29 +0000 (20:31 +0000)]
Fix error when SRCCONF is empty.

Sponsored by: EMC / Isilon Storage Division

8 years agoMore fixes for using IPv6 addresses with RDMA:
hselasky [Fri, 22 Apr 2016 18:16:12 +0000 (18:16 +0000)]
More fixes for using IPv6 addresses with RDMA:

- Added check that the SCOPE ID is only restored for IPv6 linklocal
  addresses.

- Changes made by r237263 in the "cma_bind_addr()" function did not
  check if the socket address was of type IPv6 and used the IPv4
  socket address for IPv6 addresses. This caused the function to
  fail. Fixed this.

- In the "rdma_gid2ip()" function and some other places the "sin6_len"
  and "sin6_scope_id" fields were not set for IPv6 socket
  addresses. Fixed this.

- The scope ID is not stored as part of the GID entries and must be
  passed as an argument to "rdma_gid2ip()".

- Added new method to "struct ib_device" which returns a pointer to
  the network interface which belongs to the given infiniband
  device. This is needed to be able to get the scope ID for IPv6
  addresses via the associated ethernet interface.

- Added convenience function, "rdma_get_ipv6_scope_id()", to get the
  scope ID for IPv6 addresses.

- Implemented new "get_netdev" method for mlx4ib. Other IB controller
  drivers which want to support IPv6 addresses needs to implement this
  aswell.

- Bumped the FreeBSD version due to changing "struct ib_device".

Sponsored by: Mellanox Technologies
MFC after: 1 week

8 years agoFix up pointer issues with lib/libkvm
ngie [Fri, 22 Apr 2016 18:05:34 +0000 (18:05 +0000)]
Fix up pointer issues with lib/libkvm

In particular,
- avoid dereferencing NULL pointers
- test pointers against NULL, not 0
- test for errout == NULL in the top-level functions (kvm_open, kvm_openfiles,
  kvm_open2, etc)
- Replace a realloc and free on failure with reallocf

Found with: devel/cocchinelle

Differential Revision: https://reviews.freebsd.org/D5954
MFC after: 1 week
Reviewed by: jhb
Sponsored by: EMC / Isilon Storage Division

8 years agoOptionally return the output capabilities list from _OSC.
jhb [Fri, 22 Apr 2016 17:51:19 +0000 (17:51 +0000)]
Optionally return the output capabilities list from _OSC.

Both of the callers were expecting the input cap_set to be modified.
This fixes them to request cap_set to be updated with the returned buffer.

Reviewed by: jkim
Differential Revision: https://reviews.freebsd.org/D6040

8 years agoAdd ATF tests for usr.sbin/extattr
asomers [Fri, 22 Apr 2016 17:02:47 +0000 (17:02 +0000)]
Add ATF tests for usr.sbin/extattr

Add ATF tests for the existing behavior of setextattr, rmextattr, lsextattr,
and getextattr.

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

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