]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoFix typo in r292500 by adding missing conditional statement
ngie [Sun, 20 Dec 2015 05:41:12 +0000 (05:41 +0000)]
Fix typo in r292500 by adding missing conditional statement

MFC after: 1 week
X-MFC with: r292500
Pointyhat to: ngie
Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Sponsored by: EMC / Isilon Storage Division

8 years agoSimplify Kyuafile generation logic with KYUAFILE == auto and
ngie [Sun, 20 Dec 2015 05:38:06 +0000 (05:38 +0000)]
Simplify Kyuafile generation logic with KYUAFILE == auto and
related complexity with variables

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff)
Reviewed by: emaste, Evan Cramer <eccramer@gmail.com>
Sponsored by: EMC / Isilon Storage Division

8 years agoBump __FreeBSD_version for r292469.
markj [Sun, 20 Dec 2015 05:21:59 +0000 (05:21 +0000)]
Bump __FreeBSD_version for r292469.

8 years agoIntegrate the remaining tools/regression/lib/msun testcases into the
ngie [Sun, 20 Dec 2015 05:06:44 +0000 (05:06 +0000)]
Integrate the remaining tools/regression/lib/msun testcases into the
FreeBSD test suite under lib/msun/tests

MFC after: 3 weeks
X-MFC with: r292328
Sponsored by: EMC / Isilon Storage Division

8 years agoSkip the testcases on i386 (all the assertions fail) [*]
ngie [Sun, 20 Dec 2015 04:52:53 +0000 (04:52 +0000)]
Skip the testcases on i386 (all the assertions fail) [*]

Also, don't compile the ldexpl(3) testcases on platforms that don't support
the libcall (technically only x86 right now). This makes this test buildable on
arm*/mips*/powerpc*

PR: 205449 [*]
MFC after: 1 week
Tested on: stable/10 (amd64/i386), head (amd64/i386)
Sponsored by: EMC / Isilon Storage Division

8 years agoInitialize j so it doesn't print out a garbage index
ngie [Sun, 20 Dec 2015 04:42:55 +0000 (04:42 +0000)]
Initialize j so it doesn't print out a garbage index

Use it consistently instead of i in the first loop

MFC after: 3 days
X-MFC with: 292492
Sponsored by: EMC / Isilon Storage Division

8 years agoSkip infinities testcases that fail assertions on amd64 only on CURRENT
ngie [Sun, 20 Dec 2015 04:41:17 +0000 (04:41 +0000)]
Skip infinities testcases that fail assertions on amd64 only on CURRENT

PR: 205448
MFC after: never
Sponsored by: EMC / Isilon Storage Division

8 years agoDon't run test-fma on i386
ngie [Sun, 20 Dec 2015 04:32:30 +0000 (04:32 +0000)]
Don't run test-fma on i386

It completely fails all assertions on i386 on both stable/9 and stable/10

PR: 205448
MFC after: 1 week
X-MFC to: stable/10
Sponsored by: EMC / Isilon Storage Division

8 years ago- Use nitems instead of handrolling the macro
ngie [Sun, 20 Dec 2015 04:28:37 +0000 (04:28 +0000)]
- Use nitems instead of handrolling the macro
- Use a separate variable for tracking the testcase count instead
  of hardcoding the offset for the testcases

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

8 years agoDisable test-ctrig.t testcases which fail assertions on i386 [*]
ngie [Sun, 20 Dec 2015 04:17:54 +0000 (04:17 +0000)]
Disable test-ctrig.t testcases which fail assertions on i386 [*]

Also, don't compile the exp2l(3) testcases on platforms that don't support the
libcall (technically only x86 right now). This makes this test buildable on
arm*/mips*/powerpc*

Tested on: stable/10 (amd64/i386), head (amd64/i386)
PR: 205446 [*]
MFC after: 1 week
X-MFC to: stable/10
Sponsored by: EMC / Isilon Storage Division

8 years agoDisable test-ctrig.t testcases which fail assertions on i386
ngie [Sun, 20 Dec 2015 04:06:30 +0000 (04:06 +0000)]
Disable test-ctrig.t testcases which fail assertions on i386

Tested on: stable/10 (amd64/i386), head (amd64/i386)
PR: 205446
MFC after: 1 week
X-MFC to: stable/10
Sponsored by: EMC / Isilon Storage Division

8 years agox86: Detect feature flags "AVX512DQ", "AVX512IFMA", "AVX512BW", "AVX512VBMI"
cem [Sun, 20 Dec 2015 03:34:30 +0000 (03:34 +0000)]
x86: Detect feature flags "AVX512DQ", "AVX512IFMA", "AVX512BW", "AVX512VBMI"

Documented in Intel Architecture Set Extensions Programming Reference
(319433-023).

Sponsored by: EMC / Isilon Storage Division

8 years agoUpdate the test list after r292328
ngie [Sun, 20 Dec 2015 03:06:29 +0000 (03:06 +0000)]
Update the test list after r292328

Add test-invtrig to the list of tests

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd missing smbios.h #include to mute a -Wimplicit-function-declaration warning
ngie [Sun, 20 Dec 2015 02:46:51 +0000 (02:46 +0000)]
Add missing smbios.h #include to mute a -Wimplicit-function-declaration warning
after r279222

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

8 years agoAdd missing return statement to atf/printf_test to make the example
ngie [Sun, 20 Dec 2015 02:36:30 +0000 (02:36 +0000)]
Add missing return statement to atf/printf_test to make the example
complete and correct, and mute a compiler warning from clang

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

8 years agoAdd a safety net to reclaim mbufs when one of the mbuf zones become
jtl [Sun, 20 Dec 2015 02:05:33 +0000 (02:05 +0000)]
Add a safety net to reclaim mbufs when one of the mbuf zones become
exhausted.

It is possible for a bug in the code (or, theoretically, even unusual
network conditions) to exhaust all possible mbufs or mbuf clusters.
When this occurs, things can grind to a halt fairly quickly. However,
we currently do not call mb_reclaim() unless the entire system is
experiencing a low-memory condition.

While it is best to try to prevent exhaustion of one of the mbuf zones,
it would also be useful to have a mechanism to attempt to recover from
these situations by freeing "expendable" mbufs.

This patch makes two changes:

a) The patch adds a generic API to the UMA zone allocator to set a
function that should be called when an allocation fails because the
zone limit has been reached. Because of the way this function can be
called, it really should do minimal work.

b) The patch uses this API to try to free mbufs when an allocation
fails from one of the mbuf zones because the zone limit has been
reached. The function schedules a callout to run mb_reclaim().

Differential Revision: https://reviews.freebsd.org/D3864
Reviewed by: gnn
Comments by: rrs, glebius
MFC after: 2 weeks
Sponsored by: Juniper Networks

8 years agoAdd dev.fb.X.resync sysctl to resync ARM framebuffer with VideoCore
gonzo [Sun, 20 Dec 2015 00:58:22 +0000 (00:58 +0000)]
Add dev.fb.X.resync sysctl to resync ARM framebuffer with VideoCore

Some applications (e.g. Kodi) use tvservice APIs to manage HDMI
modes, power state, EDID etc. directly through VideoCore. After
these manipulations VideoCore may loose its state and needs to be
resynced with ARM. Under Linux this problem is worked around using
fbset utility that recreates framebuffer. Since there is no fbset
utility in FreeBSD we provide sysctl for userland apps to get system
back into normal mode.

8 years agoFix whitespace issues in BSD.usr.dist introduced in r291455
ngie [Sat, 19 Dec 2015 23:02:18 +0000 (23:02 +0000)]
Fix whitespace issues in BSD.usr.dist introduced in r291455

Sponsored by: EMC / Isilon Storage Division

8 years agox86: Detect feature flags "CLWB" and "PCOMMIT"
cem [Sat, 19 Dec 2015 20:47:15 +0000 (20:47 +0000)]
x86: Detect feature flags "CLWB" and "PCOMMIT"

"The availability of CLWB instruction is indicated by the presence of
the CPUID feature flag CLWB (bit 24 of the EBX register)."

CLWB is similar to CLFLUSHOPT, except that it is not required to discard
cacheline contents.

"On processors that supports PCOMMIT, PCOMMIT is enumerated through
CPUID (CPUID.7.0.EBX[22]) only when the feature is enabled by BIOS."

PCOMMIT is used to cause store-to-memory operations to become persistent
(protected from power failure).

Sponsored by: EMC / Isilon Storage Division

8 years agoMove some MIPS specific flags to be more congruent with other
imp [Sat, 19 Dec 2015 19:20:48 +0000 (19:20 +0000)]
Move some MIPS specific flags to be more congruent with other
architectures.

8 years agoCreate libstand version of uuid_from_string and uuid_to_string. The
imp [Sat, 19 Dec 2015 19:13:38 +0000 (19:13 +0000)]
Create libstand version of uuid_from_string and uuid_to_string.  The
normal libc versions of these functions use asprintf and sscanf, both
of which aren't available in the libstand world.  It's easier to
rewrite these than to try to claw those functions into libstand.
Also include uuid_create_nil, since it's safe to include. These were
written from scratch, except for bits of comments that I got from the
libc version, which are acknowledged in the source.

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

8 years agoSave the physical address passed into the kernel of the UEFI system
imp [Sat, 19 Dec 2015 19:01:43 +0000 (19:01 +0000)]
Save the physical address passed into the kernel of the UEFI system
table.

8 years agoPass the UEFI system table into the kernel from the boot loader via
imp [Sat, 19 Dec 2015 19:01:42 +0000 (19:01 +0000)]
Pass the UEFI system table into the kernel from the boot loader via
the FW_HANDLE metadata item. The kernel can get the rest of what it
needs from this.

8 years agoIntroduce a new mechanism for relocating virtual pages to a new physical
alc [Sat, 19 Dec 2015 18:42:50 +0000 (18:42 +0000)]
Introduce a new mechanism for relocating virtual pages to a new physical
address and use this mechanism when:

1. kmem_alloc_{attr,contig}() can't find suitable free pages in the physical
   memory allocator's free page lists.  This replaces the long-standing
   approach of scanning the inactive and inactive queues, converting clean
   pages into PG_CACHED pages and laundering dirty pages.  In contrast, the
   new mechanism does not use PG_CACHED pages nor does it trigger a large
   number of I/O operations.

2. on 32-bit MIPS processors, uma_small_alloc() and the pmap can't find
   free pages in the physical memory allocator's free page lists that are
   covered by the direct map.  Tested by: adrian

3. ttm_bo_global_init() and ttm_vm_page_alloc_dma32() can't find suitable
   free pages in the physical memory allocator's free page lists.

In the coming months, I expect that this new mechanism will be applied in
other places.  For example, balloon drivers should use relocation to
minimize fragmentation of the guest physical address space.

Make vm_phys_alloc_contig() a little smarter (and more efficient in some
cases).  Specifically, use vm_phys_segs[] earlier to avoid scanning free
page lists that can't possibly contain suitable pages.

Reviewed by: kib, markj
Glanced at: jhb
Discussed with: jeff
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D4444

8 years agoFix indentation to make the script more readable
bapt [Sat, 19 Dec 2015 13:19:39 +0000 (13:19 +0000)]
Fix indentation to make the script more readable

8 years agoInitialize SRCOUT3 as it may be used unitilizard for certains types of locales
bapt [Sat, 19 Dec 2015 12:28:22 +0000 (12:28 +0000)]
Initialize SRCOUT3 as it may be used unitilizard for certains types of locales

8 years agoUse :E instead of regex in ctypedef Makefiles
bapt [Sat, 19 Dec 2015 12:26:01 +0000 (12:26 +0000)]
Use :E instead of regex in ctypedef Makefiles

8 years agoFix indent after r292333.
ume [Sat, 19 Dec 2015 09:18:01 +0000 (09:18 +0000)]
Fix indent after r292333.

8 years agoProvide link state reporting so that ifconfig_llan0="DHCP" works. The
nwhitehorn [Sat, 19 Dec 2015 02:16:38 +0000 (02:16 +0000)]
Provide link state reporting so that ifconfig_llan0="DHCP" works. The
reported link state is fictional (always up) since the hypervisor does
not provide this information.

MFC after: 1 week

8 years agoed(1): Prevent possible string overflows
pfg [Fri, 18 Dec 2015 23:05:36 +0000 (23:05 +0000)]
ed(1): Prevent possible string overflows

Use strlcpy instead of strncpy to guarantee NULL termination.

Pointed out by: imp
CID: 1007252
X-MFC with: r292454

8 years agoed(1): Prevent possible string overflows
pfg [Fri, 18 Dec 2015 21:58:42 +0000 (21:58 +0000)]
ed(1): Prevent possible string overflows

CID: 1007252
MFC after: 2 weeks

8 years agoSimplify the locale generated Makefiles by using bmake multi variables for loops
bapt [Fri, 18 Dec 2015 21:34:28 +0000 (21:34 +0000)]
Simplify the locale generated Makefiles by using bmake multi variables for loops

8 years agoAdd AI_V4MAPPED and AI_ALL support for getaddrinfo(3).
ume [Fri, 18 Dec 2015 18:08:53 +0000 (18:08 +0000)]
Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3).
We need to change netdb.h to make it actually enabled.

PR: 198092
MFC after: 1 week

8 years agoUse _map_v4v6_address().
ume [Fri, 18 Dec 2015 17:57:31 +0000 (17:57 +0000)]
Use _map_v4v6_address().

Suggested by: hrs
MFC after: 1 week

8 years agoAdd AI_V4MAPPED and AI_ALL support for getaddrinfo(3).
ume [Fri, 18 Dec 2015 17:53:18 +0000 (17:53 +0000)]
Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3).

PR: 198092
MFC after: 1 week

8 years agoFix the precious change to check the pointer returned by malloc().
jhb [Fri, 18 Dec 2015 17:52:08 +0000 (17:52 +0000)]
Fix the precious change to check the pointer returned by malloc().

Submitted by: luke <luke.tw@gmail.com>
Pointy hat to: jhb

8 years agoloader.efi: show EFI error number, not full status value
emaste [Fri, 18 Dec 2015 17:39:54 +0000 (17:39 +0000)]
loader.efi: show EFI error number, not full status value

EFI return values set the high bit to indicate an error. The log
messages changed here are printed only in the case of an error,
so including the error bit is redundant. Also switch to decimal to
match the error definitions (in sys/boot/efi/include/efierr.h).

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoGenerate ipnodes.by{addr,name} from /etc/hosts for compatibility with
ume [Fri, 18 Dec 2015 17:30:22 +0000 (17:30 +0000)]
Generate ipnodes.by{addr,name} from /etc/hosts for compatibility with
FreeBSD local name resolution.
If /var/yp/ipnodes exists, we generate them from it for backward
compatibility.

Inspired by: NetBSD
MFC after: 1 week

8 years agoproc: fix a race which could result in dereference of bad p_pgrp pointer on fork
mjg [Fri, 18 Dec 2015 16:33:15 +0000 (16:33 +0000)]
proc: fix a race which could result in dereference of bad p_pgrp pointer on fork

During fork p_starcopy - p_endcopy area of a process is populated with bcopy
with only proc lock held. Another forking thread can find such a process and
proceed to access p_pgrp included in said area.

Fix the problem by moving the field outside. It is being properly assigned
later.

Reviewed by: kib
Diagnosed by: kib
Tested by: Fabian Keil <freebsd-listen fabiankeil.de>
MFC after: 10 days

8 years agoEnable PRINTF_BUFR_SIZE on powerpc64, following r194204 on x86. The kernel
nwhitehorn [Fri, 18 Dec 2015 14:35:27 +0000 (14:35 +0000)]
Enable PRINTF_BUFR_SIZE on powerpc64, following r194204 on x86. The kernel
message garbling was becoming very noticeable on the 64-CPU systems we now
support and run on.

8 years agoIt turns out that it's OK to sleep in this context, so use M_WAITOK
imp [Fri, 18 Dec 2015 14:10:00 +0000 (14:10 +0000)]
It turns out that it's OK to sleep in this context, so use M_WAITOK
for the softc for the delay module.

Noticed by: rpokala@

8 years ago- Keep hosts.by{name,addr} IPv4 only.
ume [Fri, 18 Dec 2015 11:20:50 +0000 (11:20 +0000)]
- Keep hosts.by{name,addr} IPv4 only.
- Add comment how we handle hosts and ipnodes. (from NetBSD)

MFC after: 1 week.

8 years agoAdd au_notify.2 and MLINKs (added in OpenBSM 1.2 alpha 4).
brueffer [Fri, 18 Dec 2015 09:50:24 +0000 (09:50 +0000)]
Add au_notify.2 and MLINKs (added in OpenBSM 1.2 alpha 4).

MFC after: 2 weeks

8 years agoRegenerate config.h for OpenBSM 1.2 alpha 4.
brueffer [Fri, 18 Dec 2015 09:49:11 +0000 (09:49 +0000)]
Regenerate config.h for OpenBSM 1.2 alpha 4.

MFC after: 2 weeks

8 years agoMerge OpenBSM 1.2 alpha 4.
brueffer [Fri, 18 Dec 2015 09:48:01 +0000 (09:48 +0000)]
Merge OpenBSM 1.2 alpha 4.

MFC after: 2 weeks
Relnotes: yes

8 years agoAdd a generic firmware dependent handle to pass from the loader to the
imp [Fri, 18 Dec 2015 06:13:18 +0000 (06:13 +0000)]
Add a generic firmware dependent handle to pass from the loader to the
kernel. This will be used for passing in things like the system table
from EFI or other similar metadata that can be used by the kernel to
communicate with the firmware.

8 years agoNo need to test command values this way. There can be only one, even
imp [Fri, 18 Dec 2015 05:55:24 +0000 (05:55 +0000)]
No need to test command values this way. There can be only one, even
though the encoding is bit-wise today...

8 years agoUse variable names that aren't as prone to dyslexic confusion.
imp [Fri, 18 Dec 2015 05:45:49 +0000 (05:45 +0000)]
Use variable names that aren't as prone to dyslexic confusion.

Suggested by: jmallet@

8 years ago[intrng] Migrate the intrng code from sys/arm/arm to sys/kern/subr_intr.c.
adrian [Fri, 18 Dec 2015 05:43:59 +0000 (05:43 +0000)]
[intrng] Migrate the intrng code from sys/arm/arm to sys/kern/subr_intr.c.

The ci20 port (by kan@) is going to reuse almost all of the intrng code
since the SoC in question looks suspiciously like someone took an ARM
SoC design and replaced the ARM core with a MIPS core.

* migrate out the code;
* rename ARM_ -> INTR_;
* rename arm_ -> intr_;
* move the interrupt flush routine from intr.c / intrng.c into
  arm/machdep_intr.c - removing the code duplication and removing
  the ARM specific bits from here.

Thanks to the Star Wars: The Force Awakens premiere line for allowing
me a couple hours of quiet time to finish the universe builds.

Tested:

* make universe

TODO:

* The structure definitions in subr_intr.c still includes machine/intr.h
  which requires one duplicates all of the intrng definitions in
  the platform code (which kan has done, and I think we don't have to.)

  Instead I should break out the generic things (function declarations,
  common intr structures, etc) into a separate header.

* Kan has requested I make the PIC based IPI stuff optional.

8 years agoScheduling module to introduce a fixed delay into the I/O path.
imp [Fri, 18 Dec 2015 05:39:25 +0000 (05:39 +0000)]
Scheduling module to introduce a fixed delay into the I/O path.

8 years agoCreate a simplebus PNP info wrapper.
imp [Fri, 18 Dec 2015 05:29:22 +0000 (05:29 +0000)]
Create a simplebus PNP info wrapper.

Differential Review: https://reviews.freebsd.org/D4517

8 years agoFlag sysctl hw.mmc.debug as a tunable, since often you want to debug the
ian [Fri, 18 Dec 2015 01:32:43 +0000 (01:32 +0000)]
Flag sysctl hw.mmc.debug as a tunable, since often you want to debug the
bus probing during system startup.

8 years agoFix the clock divisor calc for imx6 sdcard bus speed.
ian [Fri, 18 Dec 2015 01:25:30 +0000 (01:25 +0000)]
Fix the clock divisor calc for imx6 sdcard bus speed.

I don't know what alternate universe I was inhabiting when I wrote it
originally, but apparently the basic workings of mathematics were different
than in this universe.  I also can't explain how it ever worked, except "by
accident", because completely bogus values were being written into the
divisor register.

8 years agoioat(4): Add an API to get HW revision
cem [Thu, 17 Dec 2015 23:21:37 +0000 (23:21 +0000)]
ioat(4): Add an API to get HW revision

Different revisions support different operations.  Refer to Intel
External Design Specifications to figure out what your hardware
supports.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix regression in if_ndis in r280347.
glebius [Thu, 17 Dec 2015 21:01:19 +0000 (21:01 +0000)]
Fix regression in if_ndis in r280347.

Submitted by: avos
Reported by: Ev Bogdanov <evbogdanov yahoo.com>
Tested by: Ivan Kormachev <ikormachev depit.ru>
MFC after: 3 days

8 years agoExit cleanly if malloc() fails to allocate a buffer for a copy of the
jhb [Thu, 17 Dec 2015 20:42:05 +0000 (20:42 +0000)]
Exit cleanly if malloc() fails to allocate a buffer for a copy of the
current MBR.

PR: 205322
Submitted by: Alexander Kuleshov <kuleshovmail@gmail.com>
MFC after: 1 week

8 years agot seems certain Intel GPUs use GPIO bitbanging over a child device
jhb [Thu, 17 Dec 2015 20:33:20 +0000 (20:33 +0000)]
t seems certain Intel GPUs use GPIO bitbanging over a child device
instead of GMBUS access for I2C transfers.  The GMBUS driver falls back
to this mode when a transfer times out.  However, the first transfer to
timeout was sending the request back to itself resulting in an panic due
to recursing on a lock.  Fix it to forward the request on to the proper
device.  This appears to have been accidentally changed in r277487.

Reported by: Joe Maloney <jmaloney@pcbsd.org>
Reviewed by: adrian, dumbbell, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D4599

8 years agoIncorrect length in calloc() call, already fixed upstream.
des [Thu, 17 Dec 2015 19:36:25 +0000 (19:36 +0000)]
Incorrect length in calloc() call, already fixed upstream.

PR: 204769
Submitted by: David Binderman <dcb314@hotmail.com>
MFC after: 1 week

8 years agoImport RISC-V machine headers. This is a minimal set required to compile
br [Thu, 17 Dec 2015 18:44:30 +0000 (18:44 +0000)]
Import RISC-V machine headers. This is a minimal set required to compile
kernel and userland.

Reviewed by: andrew, imp, kib
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D4554

8 years agovm_page_replace: add wrapper to KASSERT about old page
cem [Thu, 17 Dec 2015 17:48:57 +0000 (17:48 +0000)]
vm_page_replace: add wrapper to KASSERT about old page

It turns out the callers of vm_page_replace know exactly which page they are
replacing and would like to assert about it.  Change those from hard panics to
KASSERTs, and provide them with a wrapper so they don't have to deal with
warnings from an INVARIANTS-dependent dead store of the return value of
vm_page_replace.

Submitted by: Ryan Libby <rlibby@gmail.com>
Reviewed by: alc, kib (earlier version)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D4497

8 years agoSupport the variant of the interrupt-map property where the parent bus has
andrew [Thu, 17 Dec 2015 17:00:04 +0000 (17:00 +0000)]
Support the variant of the interrupt-map property where the parent bus has
the #address-cells property set. For this we need to read more data before
the parent interrupt description.

this is only enabled on arm64 for now as it's not quite compliant with the
ePAPR spec. We should use a default of 2 where the #address-cells property
is missing, however this will need further testing across architectures.

Obtained from: ABT Systems Ltd
Sponsored by: SoftIron Inc
Differential Revision: https://reviews.freebsd.org/D4518

8 years agoRevert r292275 & r292379
smh [Thu, 17 Dec 2015 14:41:30 +0000 (14:41 +0000)]
Revert r292275 & r292379

glebius has concerns about these changes so reverting those can be discussed
and addressed.

Sponsored by: Multiplay

8 years agoRIP Juergen Lock (nox@FreeBSD.org), you and your contributions won't be forgotten.
brueffer [Thu, 17 Dec 2015 10:37:11 +0000 (10:37 +0000)]
RIP Juergen Lock (nox@FreeBSD.org), you and your contributions won't be forgotten.

8 years agoSwitch the IPsec related statistics to using the built in sysctl
gnn [Thu, 17 Dec 2015 02:02:09 +0000 (02:02 +0000)]
Switch the IPsec related statistics to using the built in sysctl
variable set rather than reading from kernel memory.
This also makes the -z (zero) flag work correctly

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D4591

8 years agoConsistently use ${AWK} instead of hard-coding the program name.
markj [Thu, 17 Dec 2015 00:02:53 +0000 (00:02 +0000)]
Consistently use ${AWK} instead of hard-coding the program name.

MFC after: 3 days

8 years agoSupport an arbitrary number of arguments to DTrace syscall probes.
markj [Thu, 17 Dec 2015 00:00:27 +0000 (00:00 +0000)]
Support an arbitrary number of arguments to DTrace syscall probes.

Rather than pushing all eight possible arguments into dtrace_probe()'s
stack frame, make the syscall_args struct for the current syscall available
via the current thread. Using a custom getargval method for the systrace
provider, this allows any syscall argument to be fetched, even in kernels
that have modified the maximum number of system call arguments.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix breakage caused by r292373 in ZFS/FUSE/NFS/SMBFS.
glebius [Wed, 16 Dec 2015 23:48:50 +0000 (23:48 +0000)]
Fix breakage caused by r292373 in ZFS/FUSE/NFS/SMBFS.

With the new VOP_GETPAGES() KPI the "count" argument counts pages already,
and doesn't need to be translated from bytes to pages.

While here make it consistent that *rbehind and *rahead are updated only
if we doesn't return error.

Pointy hat to: glebius

8 years agoRemove the unused systrace device file and fix style bugs.
markj [Wed, 16 Dec 2015 23:46:27 +0000 (23:46 +0000)]
Remove the unused systrace device file and fix style bugs.

MFC after: 1 week

8 years agoFix style issues around existing SDT probes.
markj [Wed, 16 Dec 2015 23:39:27 +0000 (23:39 +0000)]
Fix style issues around existing SDT probes.

- Use SDT_PROBE<N>() instead of SDT_PROBE(). This has no functional effect
  at the moment, but will be needed for some future changes.
- Don't hardcode the module component of the probe identifier. This is
  set automatically by the SDT framework.

MFC after: 1 week

8 years agovm_page.h: page busy macro fixups
cem [Wed, 16 Dec 2015 23:23:12 +0000 (23:23 +0000)]
vm_page.h: page busy macro fixups

Minor changes to:
  - delete extraneous trailing semicolons from macro definitions, and
  - correct spelling of "busying" in panic messages

Submitted by: Ryan Libby <rlibby@gmail.com>
Reviewed by: alc, kib
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D4577

8 years agoFix issues introduced by r292275
smh [Wed, 16 Dec 2015 22:26:28 +0000 (22:26 +0000)]
Fix issues introduced by r292275

* Fix panic for etherswitches which don't have a LLADDR.
* Disabled DELAY in unsolicited NDA, which needs further work.
* Fixed missing DELAY in carp_send_na.
* style(9) fix.

Reported by: kp & melifaro
X-MFC-With: r292275
MFC after: 1 month
Sponsored by: Multiplay

8 years agoA change to KPI of vm_pager_get_pages() and underlying VOP_GETPAGES().
glebius [Wed, 16 Dec 2015 21:30:45 +0000 (21:30 +0000)]
A change to KPI of vm_pager_get_pages() and underlying VOP_GETPAGES().

o With new KPI consumers can request contiguous ranges of pages, and
  unlike before, all pages will be kept busied on return, like it was
  done before with the 'reqpage' only. Now the reqpage goes away. With
  new interface it is easier to implement code protected from race
  conditions.

  Such arrayed requests for now should be preceeded by a call to
  vm_pager_haspage() to make sure that request is possible. This
  could be improved later, making vm_pager_haspage() obsolete.

  Strenghtening the promises on the business of the array of pages
  allows us to remove such hacks as swp_pager_free_nrpage() and
  vm_pager_free_nonreq().

o New KPI accepts two integer pointers that may optionally point at
  values for read ahead and read behind, that a pager may do, if it
  can. These pages are completely owned by pager, and not controlled
  by the caller.

  This shifts the UFS-specific readahead logic from vm_fault.c, which
  should be file system agnostic, into vnode_pager.c. It also removes
  one VOP_BMAP() request per hard fault.

Discussed with: kib, alc, jeff, scottl
Sponsored by: Nginx, Inc.
Sponsored by: Netflix

8 years agoFlag the first port on a Sheevaplug ftdi serial device as jtag.
ian [Wed, 16 Dec 2015 20:54:28 +0000 (20:54 +0000)]
Flag the first port on a Sheevaplug ftdi serial device as jtag.

8 years agosh: Fix use-after-free when attempting to modify a read-only variable.
jilles [Wed, 16 Dec 2015 20:33:47 +0000 (20:33 +0000)]
sh: Fix use-after-free when attempting to modify a read-only variable.

Reported by: bapt
MFC after: 1 week

8 years agoRemove lldb(1) files if WITHOUT_LLDB is set
emaste [Wed, 16 Dec 2015 19:48:03 +0000 (19:48 +0000)]
Remove lldb(1) files if WITHOUT_LLDB is set

Sponsored by: The FreeBSD Foundation

8 years agoEnable LLDB by default on amd64 and arm64
emaste [Wed, 16 Dec 2015 19:23:10 +0000 (19:23 +0000)]
Enable LLDB by default on amd64 and arm64

LLDB is usable for userland core file and live debugging on amd64, and
for userland core file debugging on arm64. In general it works at least
as well on FreeBSD as our in-tree gdb version, so enable it by default
to allow for broader use and testing.

An LLDB tutorial is available at http://lldb.llvm.org/tutorial.html, and
a table mapping GDB commands to LLDB commands can be found at
http://lldb.llvm.org/lldb-gdb.html .

LLDB also has some level of support for FreeBSD on arm, mips, i386,
and powerpc, but is not yet ready to have them enabled by default.

Reviewed by: gnn
Relnotes: Yes

8 years agoUse human readable representation of ip for the pxeboot.ip kenv
bapt [Wed, 16 Dec 2015 17:45:03 +0000 (17:45 +0000)]
Use human readable representation of ip for the pxeboot.ip kenv
While here use colon as a separator for pxeboot.hwaddr kenv

Sponsored by: Gandi.net

8 years agopxeboot: make the tftp loader use the option root-path directive
bapt [Wed, 16 Dec 2015 17:13:09 +0000 (17:13 +0000)]
pxeboot: make the tftp loader use the option root-path directive

pxeboot in tftp loader mode (when built with LOADER_TFTP_SUPPORT) now
prefix all the path to open with the path obtained via the option 'root-path'
directive.

This allows to be able to use the traditional content /boot out of box. Meaning
it now works pretty much like all other loaders. It simplifies hosting hosting
multiple version of FreeBSD on a tftp server.

As a consequence, pxeboot does not look anymore for a pxeboot.4th (which was
never provided)

Note: that pxeboot in tftp loader mode is not built by default.

Reviewed by: rpokala
Relnotes: yes
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D4590

8 years agoUEFI: combine GetMemoryMap and ExitBootServices and retry on error
emaste [Wed, 16 Dec 2015 16:19:18 +0000 (16:19 +0000)]
UEFI: combine GetMemoryMap and ExitBootServices and retry on error

The EFI memory map may change before or during the first
ExitBootServices call. In that case ExitBootServices returns an error,
and GetMemoryMap and ExitBootServices must be retried.

Glue together calls to GetMemoryMap(), ExitBootServices() and storage of
(now up-to-date) MODINFOMD_EFI_MAP metadata within a single function.

That new function - bi_add_efi_data_and_exit() - uses space previously
allocated in bi_load_efi_data() to store the memory map (it will fail if
that space is too short). It handles re-calling GetMemoryMap() once to
update the map key if necessary. Finally, if ExitBootServices() is
successful, it stores the memory map and its header as MODINFOMD_EFI_MAP
metadata.

ExitBootServices() calls are now done earlier, from within arch-
independent bi_load() code.

PR: 202455
Submitted by: Ganael LAPLANCHE
Reviewed by: kib
MFC after: 2 weeks
Relnotes: Yes
Differential Revision: https://reviews.freebsd.org/D4296

8 years agoBuild mount_smbfs for arm. Also sort the subdirs.
ian [Wed, 16 Dec 2015 15:26:31 +0000 (15:26 +0000)]
Build mount_smbfs for arm.  Also sort the subdirs.

8 years agoRemove redundant extern's that make the ppc compile fail.
rrs [Wed, 16 Dec 2015 15:16:44 +0000 (15:16 +0000)]
Remove redundant extern's that make the ppc compile fail.
Thanks Ed Maste for the heads up.

8 years agoAdopt assert from amd64 in pmap_remove_pages().
skra [Wed, 16 Dec 2015 10:55:19 +0000 (10:55 +0000)]
Adopt assert from amd64 in pmap_remove_pages().

Suggested by: kib
Approved by: kib (mentor)

8 years agoProvide additional lle data in IPv6 lltable dump used by ndp(8).
melifaro [Wed, 16 Dec 2015 10:14:16 +0000 (10:14 +0000)]
Provide additional lle data in IPv6 lltable dump used by ndp(8).

Before the change, things like lle state were queried via
  SIOCGNBRINFO_IN6 by ndp(8) for _each_ lle entry in dump.
This ioctl was added in 1999, probably to avoid touching rtsock code.

This change maps SIOCGNBRINFO_IN6 data to standard rtsock dump the
 following way:
  expire (already) maps to rtm_rmx.rmx_expire
  isrouter -> rtm_flags & RTF_GATEWAY
  asked -> rtm_rmx.rmx_pksent
  state -> rtm_rmx.rmx_state (maps to rmx_weight via define)

Reviewed by: ae

8 years agoAs a followup to r292330, standardize on size_t and add a few comments.
des [Wed, 16 Dec 2015 09:20:45 +0000 (09:20 +0000)]
As a followup to r292330, standardize on size_t and add a few comments.

8 years agoConvert if_stf(4) to new routing api.
melifaro [Wed, 16 Dec 2015 09:18:20 +0000 (09:18 +0000)]
Convert if_stf(4) to new routing api.

8 years agoReset bufpos to 0 immediately after refilling the buffer. Otherwise, we
des [Wed, 16 Dec 2015 09:17:07 +0000 (09:17 +0000)]
Reset bufpos to 0 immediately after refilling the buffer.  Otherwise, we
risk leaving the connection in an indeterminate state if the server fails
to send a chunk delimiter.  Depending on the application and on the sizes
of the preceding chunks, the result can be anything from missing data to a
segfault.  With this patch, it will be reported as a protocol error.

PR: 204771
MFC after: 1 week

8 years agoFix ARP reply handling changed in r286955.
melifaro [Wed, 16 Dec 2015 09:16:06 +0000 (09:16 +0000)]
Fix ARP reply handling changed in r286955.

If source of ARP request didn't pass the routing check
(e.g. not in directly connected network), be polite and
still answer the request instead of dropping frame.

Reported by: quadro at irc@rusnet

8 years agoIntegrate a number of testcases from tools/regression/lib/msun
ngie [Wed, 16 Dec 2015 09:11:11 +0000 (09:11 +0000)]
Integrate a number of testcases from tools/regression/lib/msun
into the FreeBSD test suite

There's no functional change with these testcases; they're purposely
being left in TAP format for the time being

Other testcases which crash on amd64/i386 as-is have not been
integrated yet (they need to be retested on a later version of
CURRENT, as I haven't used i386 in some time)

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

8 years agoUse fabsl instead of fabs to mute -Wabsolute-value warnings from clang
ngie [Wed, 16 Dec 2015 08:53:24 +0000 (08:53 +0000)]
Use fabsl instead of fabs to mute -Wabsolute-value warnings from clang
because `nums[]` is an array of long doubles

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoOptimize vop_stdadvise(POSIX_FADV_DONTNEED). Instead of looking up a
kib [Wed, 16 Dec 2015 08:48:37 +0000 (08:48 +0000)]
Optimize vop_stdadvise(POSIX_FADV_DONTNEED).  Instead of looking up a
buffer for each block number in the range with gbincore(), look up the
next instantiated buffer with the logical block number which is
greater or equal to the next lblkno.  This significantly speeds up the
iteration for sparce-populated range.

Move the iteration into new helper bnoreuselist(), which is structured
similarly to flushbuflist().

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation

8 years agoSimplify the loop step in the flushbuflist() and make it independed on
kib [Wed, 16 Dec 2015 08:39:51 +0000 (08:39 +0000)]
Simplify the loop step in the flushbuflist() and make it independed on
the type stability of the buffers memory.  Instead of memoizing
pointer to the next buffer and validating it, remember the next
logical block number in the bo list and re-lookup.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation

8 years agoIterate down lib/libc/tests/nss...
ngie [Wed, 16 Dec 2015 08:25:12 +0000 (08:25 +0000)]
Iterate down lib/libc/tests/nss...

MFC after: 1 week
X-MFC with: r292323
Sponsored by: EMC / Isilon Storage Division

8 years agoIntegrate tools/regression/lib/libc/nss into the FreeBSD test suite as
ngie [Wed, 16 Dec 2015 08:09:03 +0000 (08:09 +0000)]
Integrate tools/regression/lib/libc/nss into the FreeBSD test suite as
lib/libc/tests/nss

- Convert the testcases to ATF
- Do some style(9) cleanups:
-- Sort headers
-- Apply indentation fixes
-- Remove superfluous parentheses
- Explicitly print out debug printfs for use with `kyua {debug,report}`; for
  items that were overly noisy, they've been put behind #ifdef DEBUG
  conditionals
- Fix some format strings

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd ATF_REQUIRE_FEATURE and PLAIN_REQUIRE_FEATURE macros for
ngie [Wed, 16 Dec 2015 05:44:53 +0000 (05:44 +0000)]
Add ATF_REQUIRE_FEATURE and PLAIN_REQUIRE_FEATURE macros for
testing for kernel features via the feature_present(3) libcall

The semantics are similar to the other macros in the header (skip
testcase with ATF macro; exit with appropriate exit code with the
PLAIN macro)

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd Makefile accidentally missed in r292317
ngie [Wed, 16 Dec 2015 05:19:07 +0000 (05:19 +0000)]
Add Makefile accidentally missed in r292317

MFC after: 1 week
X-MFC with: r292317
Sponsored by: EMC / Isilon Storage Division

8 years agoIntegrate tools/regression/lib/libc/resolv into the FreeBSD test suite as
ngie [Wed, 16 Dec 2015 05:11:57 +0000 (05:11 +0000)]
Integrate tools/regression/lib/libc/resolv into the FreeBSD test suite as
lib/libc/tests/resolv

Convert the testcases to ATF

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove hosts that don't resolve properly with the nss and resolv tests
ngie [Wed, 16 Dec 2015 04:59:30 +0000 (04:59 +0000)]
Remove hosts that don't resolve properly with the nss and resolv tests

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoSkip unavailable pools when running zfs pool scrubs
lidl [Wed, 16 Dec 2015 04:32:33 +0000 (04:32 +0000)]
Skip unavailable pools when running zfs pool scrubs

Approved by: rpaulo (mentor)
Differential Revision: https://reviews.freebsd.org/D4588

8 years agolldb(1): Document core file option -c / -core
emaste [Wed, 16 Dec 2015 03:59:54 +0000 (03:59 +0000)]
lldb(1): Document core file option -c / -core

8 years agoKeep maintainance of GELI and make it clear which directories I'm interested in.
pjd [Wed, 16 Dec 2015 01:05:50 +0000 (01:05 +0000)]
Keep maintainance of GELI and make it clear which directories I'm interested in.