freebsd.git
9 hours agoUpdate a comment to reflect the changes in r213408. master github/master
alc [Tue, 2 Sep 2014 04:11:20 +0000 (04:11 +0000)]
Update a comment to reflect the changes in r213408.

MFC after: 5 days

10 hours agoFix typo.
ian [Tue, 2 Sep 2014 03:51:12 +0000 (03:51 +0000)]
Fix typo.

Pointy hat: ian

10 hours agoUse OF_xref_from_device(), not OF_xref_from_node(). Also, use bzero()
ian [Tue, 2 Sep 2014 03:46:24 +0000 (03:46 +0000)]
Use OF_xref_from_device(), not OF_xref_from_node().  Also, use bzero()
rather than memset().

10 hours agoAdd OF_xref_from_device() so that there's no need to have an intermediate
ian [Tue, 2 Sep 2014 03:45:01 +0000 (03:45 +0000)]
Add OF_xref_from_device() so that there's no need to have an intermediate
call to ofw_bus_get_node() to lookup info that's already in the xreflist.

10 hours agoCreate an interface for drivers to enable or disable their clocks as listed
ian [Tue, 2 Sep 2014 03:23:05 +0000 (03:23 +0000)]
Create an interface for drivers to enable or disable their clocks as listed
in the clocks=<...> properties of their FDT data.  The clock properties
consist of 2-cell tuples, each containing a clock device node reference and
a clock number.  A clock device driver can register itself as providing
this interface, then other drivers can turn the FDT clock node reference
into the corresponding device_t so that they can use the interface to query
and manipulate their clocks.

This provides convenience functions to enable or disable all the clocks
listed in the properties for a device, so most drivers will be able to
manage their clocks with a single call to fdt_clock_enable_all(dev).

11 hours agoThe anatop driver controls power and PLLs and needs to be available before
ian [Tue, 2 Sep 2014 02:56:43 +0000 (02:56 +0000)]
The anatop driver controls power and PLLs and needs to be available before
just about anything else (other than octop which provides it config info),
so make it an EARLY_DRIVER_MODULE().

11 hours agoThe ocotp driver provides access to registers containing chip configuration
ian [Tue, 2 Sep 2014 02:54:55 +0000 (02:54 +0000)]
The ocotp driver provides access to registers containing chip configuration
data that is needed by other drivers, so make it an EARLY_DRIVER_MODULE()
that loads before just about anything else.

15 hours agoFix a bug where command line arguments could be misprocessed if getopts is
dteske [Mon, 1 Sep 2014 22:53:47 +0000 (22:53 +0000)]
Fix a bug where command line arguments could be misprocessed if getopts is
used prior to f_dialog_init() -- e.g., in a script that sets
DIALOG_SELF_INITIALIZE to NULL, preventing f_dialog_init() from being run
automaticaly when `dialog.subr' is included. Caused by sub-shell processing
of arguments inheriting prior value of $OPTIND, used by getopts. Solved by
unsetting OPTIND prior to [re-]processing of positional arguments.

15 hours agoCreate a mechanism for looking up a device_t associated with an ofw/fdt
ian [Mon, 1 Sep 2014 22:40:31 +0000 (22:40 +0000)]
Create a mechanism for looking up a device_t associated with an ofw/fdt
xref handle, and for registering that association.  Also use the same data
for faster translations between node and xref handles.

Now when fdt properties contain &othernode references, a driver can find
the device instance that corresponds to &othernode, and thus can use
interfaces provided by that instance.

Reviewed by: nwhitehorn

15 hours agoAdd bsearch_b to the libc map and the stdlib header.
pfg [Mon, 1 Sep 2014 22:25:42 +0000 (22:25 +0000)]
Add bsearch_b to the libc map and the stdlib header.

bsearch_b is the Apple blocks enabled version of bsearch(3).
This was added to libc in Revision 264042 but the commit
missed the declaration required to make use of it.

While here move some other block-related functions to the
BSD_VISIBLE block as these are non-standard.

Phabric: D638
Reviewed by: theraven, wollman

17 hours agoAdd -Wthread-safety to WARNS=6.
ed [Mon, 1 Sep 2014 20:18:09 +0000 (20:18 +0000)]
Add -Wthread-safety to WARNS=6.

While there, add a NO_WTHREAD_SAFETY flag that can be used to disable
this specific warning flag. Disable it for auditdistd. We can easily
patch up auditdistd to have the right annotations to build, but as
auditdistd is intended to be portable across other operating systems,
it's not worth the effort.

Approved by: brueffer@

18 hours agoAdd lock annotations to libcuse.
ed [Mon, 1 Sep 2014 19:56:28 +0000 (19:56 +0000)]
Add lock annotations to libcuse.

- Add annotations to the lock/unlock function to indicate that the
  function is allowed to lock and unlock the underlying pthread mutex.

- Add __guarded_by() annotations to the global variables.

Approved by: hselasky@

18 hours agosdhci.h has grown a dependency on sysctl.h, include the latter where needed.
ian [Mon, 1 Sep 2014 19:20:34 +0000 (19:20 +0000)]
sdhci.h has grown a dependency on sysctl.h, include the latter where needed.

19 hours agoAccording to the ISO C standard, lgamma(-integer) returns
kargl [Mon, 1 Sep 2014 18:57:13 +0000 (18:57 +0000)]
According to the ISO C standard, lgamma(-integer) returns
inf and raises the divided-by-zero exception.  Compilers
constant fold one/zero to inf but do not raise the exception.
Introduce a volatile vzero to prevent the constant folding.

Move the declaration of zero into the main declaration block.

While here, fix a nearby disordering of 'lx,ix'

Discussed with: bde

19 hours agoRename OF_xref_phandle() to OF_node_from_xref() and add a new function
ian [Mon, 1 Sep 2014 18:51:01 +0000 (18:51 +0000)]
Rename OF_xref_phandle() to OF_node_from_xref() and add a new function
that provides the inverse translation, OF_xref_from_node().

Discussed with: nwhitehorn

19 hours agoAdd lock annotations to the threading API used by hastd.
ed [Mon, 1 Sep 2014 18:37:17 +0000 (18:37 +0000)]
Add lock annotations to the threading API used by hastd.

Approved by: pjd@

19 hours agoAdd lock annotations to the header files of our threading libraries.
ed [Mon, 1 Sep 2014 18:34:30 +0000 (18:34 +0000)]
Add lock annotations to the header files of our threading libraries.

This change extends all of the functions present in the <pthread.h> and
<threads.h> headers to have lock annotations. This will allow Clang to
warn about the following:

- Locking a function twice,
- Unlocking a function without a mutex being locked,
- Forgetting to unlock a mutex before returning,
- Destroying or reinitializing a mutex that is currenty locked,
- Using an unlocked mutex in combination with a condition variable.

Enabling these annotations already allowed me to catch a bug in one of
our userspace tools (r270749).

19 hours agoEnable lock annotations on HEAD when using Clang.
ed [Mon, 1 Sep 2014 18:28:11 +0000 (18:28 +0000)]
Enable lock annotations on HEAD when using Clang.

MFC after: never

19 hours agoAdd lock annotations to <sys/cdefs.h>.
ed [Mon, 1 Sep 2014 18:27:04 +0000 (18:27 +0000)]
Add lock annotations to <sys/cdefs.h>.

Clang has support for annotating mutexes and code that uses mutexes to
validate certain aspects of thread safety:

- Whether acquiring/releasing locks is done properly (e.g., whether you
  unlock a mutex before leaving a function).
- Whether a lock is held while reading/writing data from/to memory.

Analysis is performed at the function level. Functions can be annotated
to indicate they:

- (try to) pick up a lock,
- release a lock,
- can only be called when (not) holding a lock,
- assert that a lock is held.

Variables and structure members can be annotated to indicate that they
are guarded by a certain lock. In C++, these annotations can refer
to both global variables, but also other class/structure members. In C,
it is only possible to refer to global variables.

This change adds wrappers for the annotations used by Clang to
<sys/cdefs.h>. They currently have no effect, but this is on purpose.
This change will be merged back to FreeBSD 9 and 10, which means we can
safely experiment with these annotations on HEAD without making it
harder to port changes back.

Reviewed by: announced on arch@ and toolchain@
MFC after: 3 weeks

21 hours agoAdd vt(4) support to the console initialisation script, specifically:
se [Mon, 1 Sep 2014 16:51:57 +0000 (16:51 +0000)]
Add vt(4) support to the console initialisation script, specifically:

- Identify the console driver used and print syscons or vt as appropriate.

- If vt is used and a keymap could not be loaded, then try to replace the
  keymap name configured in rc.conf based on a replacement list in this
  script. Warn about the fact, that a syscons keyname is configured and
  report the replacement used under vt.

- If no replacement keymap is found, no keymap is loaded and a warning
  is displayed, which points at the conversion script and allows the
  conversion of keymaps not part of the official distribution.

This patch has been sent to the -hackers list for review, but no comment
has been received, yet. It is tested to work under syscons and vt on my
system (on vt with either the syscons or vt keymap file name in rc.conf).

MFC after: 3 days

21 hours agoFinal patches to the tools used to convert syscons keymaps for use with
se [Mon, 1 Sep 2014 16:26:57 +0000 (16:26 +0000)]
Final patches to the tools used to convert syscons keymaps for use with
vt.

MFC after: 3 days

21 hours agoAdd references to vt(4) to further man-pages.
se [Mon, 1 Sep 2014 16:25:08 +0000 (16:25 +0000)]
Add references to vt(4) to further man-pages.

MFC after: 3 days

21 hours agoFix a tab that somehow became 8 spaces.
kargl [Mon, 1 Sep 2014 16:24:25 +0000 (16:24 +0000)]
Fix a tab that somehow became 8 spaces.

Remove parentheses in a return statement to be consistent with the
rest of the file.

Rename sin_pi() in the float version to sin_pif().

Remove large comment that precedes sin_pif().  The comment
duplicates a comment in e_lgamma_r.c where the algorithm
is documented.

Requested by: bde

21 hours agoFix typo (by -> be).
se [Mon, 1 Sep 2014 16:12:29 +0000 (16:12 +0000)]
Fix typo (by -> be).

MFC after: 3 days

23 hours agoDo not generate unwind info in asm functions if _STANDALONE is defined.
ian [Mon, 1 Sep 2014 14:57:04 +0000 (14:57 +0000)]
Do not generate unwind info in asm functions if _STANDALONE is defined.
The .fnend op causes the assembler to emit RELOC references to unwind
support functions that don't exist in libstand.

24 hours agoMake SOCK_RAW sockets to be truly raw, not modifying received and sent
glebius [Mon, 1 Sep 2014 14:04:51 +0000 (14:04 +0000)]
Make SOCK_RAW sockets to be truly raw, not modifying received and sent
packets at all. Swapping byte order on SOCK_RAW was actually a bug, an
artifact from the BSD network stack, that used to convert a packet to
native byte order once it is received by kernel.

Other operating systems didn't follow this, and later other BSD
descendants fixed this, leaving us alone with the bug. Now it is
clear that we should fix the bug.

In collaboration with: Olivier Cochard-LabbĂ© <olivier cochard.me>
See also: https://wiki.freebsd.org/SOCK_RAW
Sponsored by: Nginx, Inc.

25 hours agoExplicitly free packet on PF_DROP, otherwise a "quick" rule with
glebius [Mon, 1 Sep 2014 13:00:45 +0000 (13:00 +0000)]
Explicitly free packet on PF_DROP, otherwise a "quick" rule with
"route-to" may still forward it.

PR: 177808
Submitted by: Kajetan Staszkiewicz <kajetan.staszkiewicz innogames.de>
Sponsored by: InnoGames GmbH

28 hours agoAdd the reverse part to rule #9. Also change its description in the
ae [Mon, 1 Sep 2014 09:30:34 +0000 (09:30 +0000)]
Add the reverse part to rule #9. Also change its description in the
netstat(8) output.

MFC after: 1 week

34 hours agoResync comments about scbus and pass for life after AHCI joined CAM.
imp [Mon, 1 Sep 2014 03:49:21 +0000 (03:49 +0000)]
Resync comments about scbus and pass for life after AHCI joined CAM.

Sponsored by: Netflix

40 hours agoCompute sin(pi*x) without actually doing the pi*x multiplication.
kargl [Sun, 31 Aug 2014 21:38:03 +0000 (21:38 +0000)]
Compute sin(pi*x) without actually doing the pi*x multiplication.
sin_pi(x) is only called for x < 0 and |x| < 2**(p-1) where p is
the precision of x.  The new argument reduction is an optimization
compared to the old code, and it removes a chunk of dead code.
Accuracy tests in the intervals (-21,-20), (-20,-19), ... (-1,0)
show no differences between the old and new code.

Obtained from: bde

44 hours ago- Nuke unused sdhci_softc.
marius [Sun, 31 Aug 2014 17:56:54 +0000 (17:56 +0000)]
- Nuke unused sdhci_softc.
- Static'ize sdhci_debug local to sdhci.c.
- Const'ify PCI device description strings.
- Nuke redundant resource ID members from sdhci_pci_softc.
- Nuke unused hw.sdhci_pci.debug tunable.
- Add support for using MSI instead of INTx, controllable via the tunable
  hw.sdhci.enable_msi (defaulting to on) and tested with a RICOH R5CE823 SD
  controller.
- Use NULL instead of 0 for pointers.

MFC after: 3 days

44 hours agoGIC (Cortex A's interrupt controller) supports up to 1020 IRQs.
br [Sun, 31 Aug 2014 17:40:19 +0000 (17:40 +0000)]
GIC (Cortex A's interrupt controller) supports up to 1020 IRQs.

44 hours agoAutomatically prefault a limited number of mappings to resident pages in
alc [Sun, 31 Aug 2014 17:38:41 +0000 (17:38 +0000)]
Automatically prefault a limited number of mappings to resident pages in
shmat(2), just like mmap(2).

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

44 hours agoIn ARM asm code, ensure that every ENTRY(foo) has a matching END(foo).
ian [Sun, 31 Aug 2014 17:21:51 +0000 (17:21 +0000)]
In ARM asm code, ensure that every ENTRY(foo) has a matching END(foo).
The EABI unwind info requires a .fnend for every .fnstart, and newer
binutils will complain about seeing two .fnstart in a row.  This change
allows newer tools to compile our code.

Reported by: bapt
Reviewed by: imp

46 hours agoPut option FDT into the base IMX6 config and remove it from the config
ian [Sun, 31 Aug 2014 15:25:40 +0000 (15:25 +0000)]
Put option FDT into the base IMX6 config and remove it from the config
of boards based on IMX6.

46 hours agoThe Marvell PJ4B cpu family is armv7, not armv6.
ian [Sun, 31 Aug 2014 15:23:49 +0000 (15:23 +0000)]
The Marvell PJ4B cpu family is armv7, not armv6.

2 days agoToss fields so that no padding field is required to achieve alignment.
glebius [Sun, 31 Aug 2014 13:30:54 +0000 (13:30 +0000)]
Toss fields so that no padding field is required to achieve alignment.

2 days agoIt is actually possible to have if_t a typedef to non-void type,
glebius [Sun, 31 Aug 2014 12:48:13 +0000 (12:48 +0000)]
It is actually possible to have if_t a typedef to non-void type,
and keep both converted to drvapi and non-converted drivers
compilable.

o Make if_t typedef to struct ifnet *.
o Remove shim functions.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

2 days agoProvide pointer from struct ifnet to struct netmap_adapter,
glebius [Sun, 31 Aug 2014 11:33:19 +0000 (11:33 +0000)]
Provide pointer from struct ifnet to struct netmap_adapter,
instead of abusing spare field.

2 days agoFix character case in examples for "camcontrol security" - should be
gavin [Sun, 31 Aug 2014 10:28:31 +0000 (10:28 +0000)]
Fix character case in examples for "camcontrol security" - should be
"-U user" not "-u user".

PR: 193179
Submitted by: milios ccsys com
MFC after: 3 days

2 days agoMove the restored #ifdef i386 test back inside the #ifdef _KERNEL block
peter [Sun, 31 Aug 2014 09:05:02 +0000 (09:05 +0000)]
Move the restored #ifdef i386 test back inside the #ifdef _KERNEL block
where it originally was.

2 days agoo Remove struct if_data from struct ifnet. Now it is merely API structure
glebius [Sun, 31 Aug 2014 06:46:21 +0000 (06:46 +0000)]
o Remove struct if_data from struct ifnet. Now it is merely API structure
  for route(4) socket and ifmib(4) sysctl.
o Move fields from if_data to ifnet, but keep all statistic counters
  separate, since they should disappear later.
o Provide function if_data_copy() to fill if_data, utilize it in routing
  socket and ifmib handler.
o Provide overridable ifnet(9) method to fetch counters. If no provided,
  if_get_counters_compat() would be used, that returns old counters.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

2 days agoUse macros instead of referencing struct if_data that resides in ifnet.
glebius [Sun, 31 Aug 2014 06:30:50 +0000 (06:30 +0000)]
Use macros instead of referencing struct if_data that resides in ifnet.

Sponsored by: Nginx, Inc.

2 days agoRemove ability to write to struct if_data residing in struct ifnet
glebius [Sun, 31 Aug 2014 06:23:54 +0000 (06:23 +0000)]
Remove ability to write to struct if_data residing in struct ifnet
via net.link.generic.IFMIB_IFDATA.*.IFDATA_GENERAL sysctl. Reasons
for removal are:
- No code in tree uses this possibility.
- The documentation ifmib(4) doesn't say that such possibility
  exist. The example provided in manual page only reads data.
- On many interfaces the feature simply doesn't work, since they
  do accounting in hardware, and overwrite if_data on tick.

Sponsored by: Nginx, Inc.

2 days agoAllow the make_dtb script to work outside of a "make buildkernel" context
ian [Sat, 30 Aug 2014 22:39:15 +0000 (22:39 +0000)]
Allow the make_dtb script to work outside of a "make buildkernel" context
by setting MACHINE from uname -m if it's not set already.

Reviewed by: imp, tuexen

2 days agoFix the handling of MMU type in the AP entry code. The ARM_MMU_V6/V7
ian [Sat, 30 Aug 2014 22:21:57 +0000 (22:21 +0000)]
Fix the handling of MMU type in the AP entry code.  The ARM_MMU_V6/V7
symbols are always #defined to 0 or 1, so use #if SYM not #if defined(SYM).
Also, it helps if you include the header file that defines the symbols.

2 days agoEnsure that ZFS ARC free memory checks include cached pages
smh [Sat, 30 Aug 2014 21:44:32 +0000 (21:44 +0000)]
Ensure that ZFS ARC free memory checks include cached pages

Also restore kmem_used() check for i386 as it has KVA limits that the raw
page counts above don't consider

PR: 187594
Reviewed by: peter
X-MFC-With: r270759
Review: D700
Sponsored by: Multiplay

2 days agoEnable SCTP support. It runs perfectly fine on a Wandboard quad.
tuexen [Sat, 30 Aug 2014 20:18:47 +0000 (20:18 +0000)]
Enable SCTP support. It runs perfectly fine on a Wandboard quad.

MFC after: 3 days

2 days agoRemove FDT option, since it is in every file, which includes this one.
tuexen [Sat, 30 Aug 2014 20:00:18 +0000 (20:00 +0000)]
Remove FDT option, since it is in every file, which includes this one.

2 days agoThe "SUB" instruction used in getcc() actually does 'x -= y' so use the
neel [Sat, 30 Aug 2014 19:59:42 +0000 (19:59 +0000)]
The "SUB" instruction used in getcc() actually does 'x -= y' so use the
proper constraint for 'x'. The "+r" constraint indicates that 'x' is an
input and output register operand.

While here generate code for different variants of getcc() using a macro
GETCC(sz) where 'sz' indicates the operand size.

Update the status bits in %rflags when emulating AND and OR opcodes.

Reviewed by: grehan

2 days agoUse define from if_var.h to access a field inside struct if_data,
glebius [Sat, 30 Aug 2014 19:55:54 +0000 (19:55 +0000)]
Use define from if_var.h to access a field inside struct if_data,
that resides in struct ifnet.

Sponsored by: Nginx, Inc.

2 days agoSet the 'inst_length' to '0' early on before any error conditions are detected
neel [Sat, 30 Aug 2014 18:35:16 +0000 (18:35 +0000)]
Set the 'inst_length' to '0' early on before any error conditions are detected
in the emulation of the task switch. If any exceptions are triggered then the
guest %rip should point to instruction that caused the task switch as opposed
to the one after it.

2 days agoReplace cvsweb link wihg svnweb URL in bktr(4) release notes.
gavin [Sat, 30 Aug 2014 18:01:45 +0000 (18:01 +0000)]
Replace cvsweb link wihg svnweb URL in bktr(4) release notes.

2 days agoSave and restore FPU state across suspend and resume. In earlier revisions
jhb [Sat, 30 Aug 2014 17:48:38 +0000 (17:48 +0000)]
Save and restore FPU state across suspend and resume.  In earlier revisions
of this patch, resumectx() called npxresume() directly, but that doesn't
work because resumectx() runs with a non-standard %cs selector.  Instead,
all of the FPU suspend/resume handling is done in C.

MFC after: 1 week

2 days agoFix the order of "const volatile" to be consistent with
kargl [Sat, 30 Aug 2014 17:31:53 +0000 (17:31 +0000)]
Fix the order of "const volatile" to be consistent with
the rest of msun.

2 days agoMake tiny volatile to prevent the compiler(s) from
kargl [Sat, 30 Aug 2014 17:14:47 +0000 (17:14 +0000)]
Make tiny volatile to prevent the compiler(s) from
constant folding expressions of the form "1 - tiny",
which are used to raise FE_INEXACT.

2 days agoMinor space/tab cleanups.
pfg [Sat, 30 Aug 2014 15:41:07 +0000 (15:41 +0000)]
Minor space/tab cleanups.

Most of them were ripped from the GSoC 2104
SMAP + kpatch project.
This is only a cosmetic change.

Taken from: Oliver Pinter (op@)
MFC after: 5 days

3 days agoAllow the iwn(4) fw 100 to be compiled into the kernel and update the
brueffer [Sat, 30 Aug 2014 13:47:05 +0000 (13:47 +0000)]
Allow the iwn(4) fw 100 to be compiled into the kernel and update the
relevant manpages.

3 days agoUse ipv6_prefer when at least one ifconfig_IF_ipv6 is configured.
hrs [Sat, 30 Aug 2014 07:08:10 +0000 (07:08 +0000)]
Use ipv6_prefer when at least one ifconfig_IF_ipv6 is configured.

Discussed on: -net@

3 days agoAdd missing proctree locking to fill_kinfo_proc consumers.
mjg [Sat, 30 Aug 2014 03:10:55 +0000 (03:10 +0000)]
Add missing proctree locking to fill_kinfo_proc consumers.

This fixes r270444.

Pointy hat: mjg
Reported by: many
MFC after: 1 week

3 days agoWe were returning 20 bytes as the FIS size to send, but only
imp [Sat, 30 Aug 2014 02:13:09 +0000 (02:13 +0000)]
We were returning 20 bytes as the FIS size to send, but only
initializing 16. Initialize all 20 so we don't send garbage in the
Auxiliary register. The SATA standard mandates a 5 dword length for
the Host to Device FIS.

Sponsored by: Netflix

3 days agoAdd a few defines and packet types for SATA 3.2 and FPDMA (First Party
imp [Sat, 30 Aug 2014 02:13:04 +0000 (02:13 +0000)]
Add a few defines and packet types for SATA 3.2 and FPDMA (First Party
DMA).

Sponsored by: Netflix

3 days agoUpdate the date for last example.
imp [Sat, 30 Aug 2014 02:12:58 +0000 (02:12 +0000)]
Update the date for last example.

Sponsored by: Netflix

3 days agoWhen anouncing link state changes on an 802.11 interface with a vap,
jhb [Fri, 29 Aug 2014 22:01:47 +0000 (22:01 +0000)]
When anouncing link state changes on an 802.11 interface with a vap,
announce the change on the vap's ifnet instead of the main ifnet.  This
matches the behavior of other wireless drivers in the tree and allows the
default devd configuration to correctly start dhclient automatically after
an ndis wireless device associates.

MFC after: 2 weeks

3 days agoRename shm_dict_init to shm_init to fix a compiler warning.
andreast [Fri, 29 Aug 2014 21:50:32 +0000 (21:50 +0000)]
Rename shm_dict_init to shm_init to fix a compiler warning.

Reviewed by: jhb

3 days ago- Add a new structure type for the ACPI 3.0 SMAP entry that includes the
jhb [Fri, 29 Aug 2014 21:25:47 +0000 (21:25 +0000)]
- Add a new structure type for the ACPI 3.0 SMAP entry that includes the
  optional attributes field.
- Add a 'machdep.smap' sysctl that exports the SMAP table of the running
  system as an array of the ACPI 3.0 structure.  (On older systems, the
  attributes are given a value of zero.)  Note that the sysctl only
  exports the SMAP table if it is available via the metadata passed from
  the loader to the kernel.  If an SMAP is not available, an empty array
  is returned.
- Add a format handler for the ACPI 3.0 SMAP structure to the sysctl(8)
  binary to format the SMAP structures in a readable format similar to
  the format found in boot messages.

MFC after: 2 weeks

3 days agoFix a typo.
jhb [Fri, 29 Aug 2014 21:20:36 +0000 (21:20 +0000)]
Fix a typo.

3 days agoMFamd64: Add a machdep.bootmethod sysctl to inform the installer which
jhb [Fri, 29 Aug 2014 21:08:40 +0000 (21:08 +0000)]
MFamd64: Add a machdep.bootmethod sysctl to inform the installer which
firmware method was used for booting.  This is hardcoded to BIOS on i386.

PR: 192962
Reviewed by: nwhitehorn
MFC after: 1 week

3 days agoAdd the new shm_ino field to struct shmfd. Missed in 270823.
jhb [Fri, 29 Aug 2014 20:50:49 +0000 (20:50 +0000)]
Add the new shm_ino field to struct shmfd.  Missed in 270823.

Reported by: peter
Pointy hat to: jhb

3 days agoUse a unit number allocator to provide suitable st_dev and st_ino values
jhb [Fri, 29 Aug 2014 18:18:29 +0000 (18:18 +0000)]
Use a unit number allocator to provide suitable st_dev and st_ino values
for POSIX shared memory descriptors.  The implementation is similar to
that used for pipes.

MFC after: 1 week

3 days ago* Add SIOCGI2C driver ioctl used to retrieve i2c info.
melifaro [Fri, 29 Aug 2014 18:02:58 +0000 (18:02 +0000)]
* Add SIOCGI2C driver ioctl used to retrieve i2c info.
* Convert ixgbe to use this ioctl
* Convert ifconfig to use generic i2c handler for  "ix" interfaces.

Approved by: Eric Joyner (ixgbe part)
MFC after: 2 weeks
Sponsored by: Yandex LLC

3 days agoForward declare struct kiocb, which is only used for an unsued function
bz [Fri, 29 Aug 2014 14:47:05 +0000 (14:47 +0000)]
Forward declare struct kiocb, which is only used for an unsued function
argument but not actually defined anywhere.

This fixes the compile complaining about
"declaration of 'struct kiocb' will not be visible outside of this function".

MFC after: 2 weeks
X-MFC with: whatever changed caused the breakage ;-)

3 days agoTry to also unbreak powerpc complaining about
bz [Fri, 29 Aug 2014 14:38:57 +0000 (14:38 +0000)]
Try to also unbreak powerpc complaining about
"cast from pointer to integer of different size".

MFC after: 3 days
X-MFC with: r270755

4 days agoThese functions are #defined to "osdep" specific names without the "_mem"
bz [Fri, 29 Aug 2014 12:48:38 +0000 (12:48 +0000)]
These functions are #defined to "osdep" specific names without the "_mem"
extension.  Provide prototypes for the actual implementations.
Correct function arguments to match the implementations.

MFC after: 3 days
X-MFC with: r270755

4 days agoProperly place #ifdef INET and #ifdef INET6 around variable declarations
bz [Fri, 29 Aug 2014 12:45:14 +0000 (12:45 +0000)]
Properly place #ifdef INET and #ifdef INET6 around variable declarations
and code to make the code compile.

Give the function seems to be slightly mixed with csum and tso,
make it non-fatal if we try to setup thing on a kernel without IP
support.  In practise the printf on the console will probably still
make your machine unhappy.

MFC after: 3 days
X-MFC with: r270755

4 days agoProperly handle prefetch only for amd64 and i386 as we do elsewhere.
bz [Fri, 29 Aug 2014 12:40:01 +0000 (12:40 +0000)]
Properly handle prefetch only for amd64 and i386 as we do elsewhere.

In general theraven is right that we should factr this out and provide
a general and per-arch implementation that everything can use.

MFC after: 3 days
X-MFC with: r270755

4 days agoDocument the whole settings needed to build a debug version of rtld.
kib [Fri, 29 Aug 2014 10:44:58 +0000 (10:44 +0000)]
Document the whole settings needed to build a debug version of rtld.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 days agoOptimize r270798, only do the second pass over non-plt relocations
kib [Fri, 29 Aug 2014 10:43:56 +0000 (10:43 +0000)]
Optimize r270798, only do the second pass over non-plt relocations
when the first pass found IFUNCs.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

4 days agoFirst try on fixing some more compile errors without actually testing:
bz [Fri, 29 Aug 2014 09:37:18 +0000 (09:37 +0000)]
First try on fixing some more compile errors without actually testing:
- use proper __FreeBSD_version check and more importantly check for __am64__
  to be defined.  Whether the FreeBSD(_version) checks are needed is a
  different question.
- cast uint64_t to uintmax_t and use %jx for printing.

Note: there are more values that could be printed in that status function
but leave that for the future;  printf doesn't seem to be the right
way to do it anyway.
Note: there is more breakage related to i40e_allocate_dma*() having
conflicting declarations, so more fixes to come.

PR: 193112
MFC after: 3 days
X-MFC with: r270755

4 days agoIFUNC symbol type shall be processed for non-PLT relocations,
kib [Fri, 29 Aug 2014 09:29:10 +0000 (09:29 +0000)]
IFUNC symbol type shall be processed for non-PLT relocations,
e.g. when a global variable is initialized with a pointer to ifunc.
Add symbol type check and call resolver for STT_GNU_IFUNC symbol types
when processing non-PLT relocations, but only after non-IFUNC
relocations are done.  The two-phase proceessing is required since
resolvers may reference other symbols, which must be ready to use when
resolver calls are done.

Restructure reloc_non_plt() on x86 to call find_symdef() and handle
IFUNC in single place.

For non-x86 reloc_non_plt(), check for call for IFUNC relocation and
do nothing, to avoid processing relocs twice.

PR: 193048
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

4 days agoDirect access to the quota files, in particular, lookup, causes lock
kib [Fri, 29 Aug 2014 09:04:24 +0000 (09:04 +0000)]
Direct access to the quota files, in particular, lookup, causes lock
conflict with the quota metadata access.  Mark quota vnode lock as
recursive and always exclusive to avoid the problem.

Reported by: hrs
Tested by: hrs, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 days agoAdd function and wrapper to switch lockmgr and vnode lock back to
kib [Fri, 29 Aug 2014 09:02:01 +0000 (09:02 +0000)]
Add function and wrapper to switch lockmgr and vnode lock back to
auto-promotion of shared to exclusive.

Tested by: hrs, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 days agovt(4): Indicate that KDSETRAD case falls through the next case
dumbbell [Fri, 29 Aug 2014 08:20:03 +0000 (08:20 +0000)]
vt(4): Indicate that KDSETRAD case falls through the next case

CID: 1229953
MFC after: 1 week

4 days agovt(4): Change vb_history_size from "int" to "unsigned int"
dumbbell [Fri, 29 Aug 2014 08:16:31 +0000 (08:16 +0000)]
vt(4): Change vb_history_size from "int" to "unsigned int"

CID: 1230002, 1230003
MFC after: 1 week

4 days agoReturn false status only when adding a route is failed. It could
hrs [Fri, 29 Aug 2014 08:02:35 +0000 (08:02 +0000)]
Return false status only when adding a route is failed.  It could
erroneously return false due to an afexists() check loop in routing_start().

4 days agoRestructure rc.d scripts for kerberos5 daemons:
hrs [Fri, 29 Aug 2014 07:51:47 +0000 (07:51 +0000)]
Restructure rc.d scripts for kerberos5 daemons:

- Rename $kerberos5_server_enable with $kdc_enable and rename
  rc.d/kerberos with rc.d/kdc.

- Rename $kadmin5_server_enable with $kadmind_enable.

- Rename ${kerberos5,kpasswdd}_server with ${kdc,kpasswdd}_program.

- Fix rc.d/{kadmind,kerberos,kpasswdd,kfd} scripts not to change variables
  after load_rc_config().

- Add rc.d/ipropd_master and rc.d/ipropd_slave scripts.  These are
  for iprop-master(8) and iprop-slave(8).  Keytab used for iprop service is
  defined in ipropd_{master,slave}_keytab (/etc/krb5.keytab by default).

- Add dependency on rc.d/kdc to SERVERS.  rc.d/kdc must be invoked as early
  as possible before scripts divided by rc.d/SERVERS.

Note that changes to rc.d/{kdc,kpasswdd,kadmind} are backward-compatible
with the old configuration variables:
${kerberos5,kpasswdd,kadmin5}_server{,_enable,_flags}.

4 days ago- Add a warning message when an IPv6 address is specified with no prefixlen.
hrs [Fri, 29 Aug 2014 06:31:18 +0000 (06:31 +0000)]
- Add a warning message when an IPv6 address is specified with no prefixlen.
- Use a parameter argument in jls(8) instead of doing grep.

4 days agoFix rc.d/gssd script to define the default values in a standard way.
hrs [Fri, 29 Aug 2014 06:23:00 +0000 (06:23 +0000)]
Fix rc.d/gssd script to define the default values in a standard way.

4 days agoFix the NOINET and NOINET6 builds.
jfv [Fri, 29 Aug 2014 00:33:31 +0000 (00:33 +0000)]
Fix the NOINET and NOINET6 builds.

MFC after:3 days

4 days agoAdd Alonso Schaich to ports developers. Mentors: makc@, rakuco@
alonso [Thu, 28 Aug 2014 23:32:56 +0000 (23:32 +0000)]
Add Alonso Schaich to ports developers. Mentors: makc@, rakuco@

Approved by: rakuco (mentor)

4 days agoRemove the DEV_NETMAP code from the ixl drivers, it was a placeholder
jfv [Thu, 28 Aug 2014 22:52:20 +0000 (22:52 +0000)]
Remove the DEV_NETMAP code from the ixl drivers, it was a placeholder
and not yet ready to be defined, and its causing build errors.

MFC after: 3 days

4 days agoSome corrections, reformating, and additional info about the VF
jfv [Thu, 28 Aug 2014 21:45:07 +0000 (21:45 +0000)]
Some corrections, reformating, and additional info about the VF
driver in the README.

MFC after: 1 day

4 days agoAdd canonical population of a disk / thumb drive from an image
imp [Thu, 28 Aug 2014 21:30:39 +0000 (21:30 +0000)]
Add canonical population of a disk / thumb drive from an image
example.

4 days agoRefactor ZFS ARC reclaim logic to be more VM cooperative
smh [Thu, 28 Aug 2014 19:50:08 +0000 (19:50 +0000)]
Refactor ZFS ARC reclaim logic to be more VM cooperative

Prior to this change we triggered ARC reclaim when kmem usage passed 3/4
of the total available, as indicated by vmem_size(kmem_arena, VMEM_ALLOC).

This could lead large amounts of unused RAM e.g. on a 192GB machine with
ARC the only major RAM consumer, 40GB of RAM would remain unused.

The old method has also been seen to result in extreme RAM usage under
certain loads, causing poor performance and stalls.

We now trigger ARC reclaim when the number of free pages drops below the
value defined by the new sysctl vfs.zfs.arc_free_target, which defaults
to the value of vm.v_free_target.

Credit to Karl Denninger for the original patch on which this update was
based.

PR: 191510 and 187594
Tested by: dteske
MFC after: 1 week
Relnotes: yes
Sponsored by: Multiplay

4 days agoFix build breakage caused by ixl driver
smh [Thu, 28 Aug 2014 18:59:39 +0000 (18:59 +0000)]
Fix build breakage caused by ixl driver

Fix missing includes and invalid vars in ixl / ixlv driver added by r270346
which caused build failures for GENERIC kernel after it was made default
by r270755.

X-MFC-With: r270346 / r270755
Sponsored by: Multiplay

4 days agoIn r253839 the default behaviour of ld(1) was changed such that all
tijl [Thu, 28 Aug 2014 18:33:42 +0000 (18:33 +0000)]
In r253839 the default behaviour of ld(1) was changed such that all
libraries that need to be linked into an executable or library have to be
listed on the command line explicitly.  This commit fixes a bug in ld(1)
where it would scan dependencies of the libraries on the command line and
link them if needed if they were also found in ld.so.cache.

The important bit of the patch is the initialisation of needed.by such that
libraries found by scanning dependencies are marked as such and not used in
the link.

The patch is a backport of binutils git commit
d5c8b1f8561426b41aa5330ed60f578178fe6be2

The author gave permission to use it under GPLv2 terms.

PR: 192062
Exp-run by: antoine
MFC after: 1 week

4 days agoAdd XL710 device entries to NOTES, and directories to the module
jfv [Thu, 28 Aug 2014 17:40:19 +0000 (17:40 +0000)]
Add XL710 device entries to NOTES, and directories to the module
Makefile so they will be built.

MFC after: 1 day

4 days agoUse "file -s", so that we can run vmrun.sh against special devices such
rodrigc [Thu, 28 Aug 2014 16:26:13 +0000 (16:26 +0000)]
Use "file -s", so that we can run vmrun.sh against special devices such
as /dev/md memory file systems

Reviewed by: neel

5 days agodrm/radeon: Fix a memory leak when radeonkms is unloaded
dumbbell [Thu, 28 Aug 2014 12:40:31 +0000 (12:40 +0000)]
drm/radeon: Fix a memory leak when radeonkms is unloaded

MFC after: 1 week

5 days agoUnlock the right lock.
ed [Thu, 28 Aug 2014 11:50:52 +0000 (11:50 +0000)]
Unlock the right lock.

The adist_remote_lock is not held in this place, whereas the
adist_recv_list_lock lock is and is picked up during the next iteration.

I found this by annotating our libpthread with Clang's -Wthread-safety
attributes. I will send out a patch for this in the nearby future,
because it's awesome.

MFC after: 2 weeks