]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoMinor workqueue cleanup:
Hans Petter Selasky [Mon, 21 Dec 2015 11:58:59 +0000 (11:58 +0000)]
Minor workqueue cleanup:
- Make some functions global instead of inline to ease debugging.
- Fix some minor style issues.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoRecheck curthread->td_su after the VFS_SYNC() call, and re-sync if the
Konstantin Belousov [Mon, 21 Dec 2015 11:50:32 +0000 (11:50 +0000)]
Recheck curthread->td_su after the VFS_SYNC() call, and re-sync if the
ast was rescheduled during VFS_SYNC().  It is possible that enough
parallel writes or slow/hung volume result in VFS_SYNC() deferring to
the ast flushing of workqueue.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoIf we end up following a CNAME chain that does not find
Hajimu UMEMOTO [Mon, 21 Dec 2015 11:24:14 +0000 (11:24 +0000)]
If we end up following a CNAME chain that does not find
any data return that instead of internal error.

PR: 156684
Obtained from: NetBSD
MFC after: 1 week

8 years agoImplement sleepable RCU mechanism using shared exclusive locks.
Hans Petter Selasky [Mon, 21 Dec 2015 11:03:12 +0000 (11:03 +0000)]
Implement sleepable RCU mechanism using shared exclusive locks.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoImplement ACCESS_ONCE(), WRITE_ONCE() and READ_ONCE().
Hans Petter Selasky [Mon, 21 Dec 2015 10:56:38 +0000 (10:56 +0000)]
Implement ACCESS_ONCE(), WRITE_ONCE() and READ_ONCE().

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoFix 'make depend'
Ulrich Spörlein [Mon, 21 Dec 2015 09:38:45 +0000 (09:38 +0000)]
Fix 'make depend'

8 years agoSkip the testcases if mac_bsdextended(4) isn't detected on the
Enji Cooper [Mon, 21 Dec 2015 08:58:14 +0000 (08:58 +0000)]
Skip the testcases if mac_bsdextended(4) isn't detected on the
system

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

8 years agoMark `subject matching jailid` testcase as an unexpected failure with
Enji Cooper [Mon, 21 Dec 2015 08:53:26 +0000 (08:53 +0000)]
Mark `subject matching jailid` testcase as an unexpected failure with
TODO to ensure that the testcase isn't marked as a failure

PR: 205481
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoMake test_matches.sh into a series of TAP testcases
Enji Cooper [Mon, 21 Dec 2015 08:14:45 +0000 (08:14 +0000)]
Make test_matches.sh into a series of TAP testcases

Use temporary filesystems / memory disks instead of a hardcoded path
which doesn't exist on test systems

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

8 years ago- Use 1 for an exit code instead of -1 with err, errx, and exit
Enji Cooper [Mon, 21 Dec 2015 07:04:01 +0000 (07:04 +0000)]
- Use 1 for an exit code instead of -1 with err, errx, and exit
- Add unistd.h for getuid(3)
- Sort #includes

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

8 years agoThere's no such program as [-n :(. Add the missing space. Also,
Warner Losh [Mon, 21 Dec 2015 05:08:20 +0000 (05:08 +0000)]
There's no such program as [-n :(. Add the missing space. Also,
work when the object directory doesn't exist yet. realpath hates
us, so use the backup of the realpath arg when that happens.

8 years agox86: Add CPUID_STDEXT_* macros for CPU feature bits
Conrad Meyer [Mon, 21 Dec 2015 04:42:58 +0000 (04:42 +0000)]
x86: Add CPUID_STDEXT_* macros for CPU feature bits

A follow-up to r292478 and r292488.

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd strlcat() and strlcpy() to libstand32. This should have been part of
Ian Lepore [Mon, 21 Dec 2015 02:02:43 +0000 (02:02 +0000)]
Add strlcat() and strlcpy() to libstand32.  This should have been part of
r292234, but I forgot there was a libstand32.

Submitted by: martymac
Pointy hat: ian

8 years ago[mips] print out l2 cache configuration if it exists.
Adrian Chadd [Mon, 21 Dec 2015 01:48:16 +0000 (01:48 +0000)]
[mips] print out l2 cache configuration if it exists.

The Ingenic JZ7480 SoC that is on the Imagination Technologies CI20 board
has an L2 cache:

Cache info:
  picache_stride    = 4096
  picache_loopcount = 8
  pdcache_stride    = 4096
  pdcache_loopcount = 8
cpu0: Ingenic Xburst processor v79.2
  MMU: Standard TLB, 32 entries
  L1 i-cache: 8 ways of 128 sets, 32 bytes per line
  L1 d-cache: 8 ways of 128 sets, 32 bytes per line
  L2 cache: 8 ways of 256 sets, 128 bytes per line, 256 KiB total size
  Config1=0xbe67338b<WatchRegs,EJTAG,FPU>
  Config2=0x80000267
  Config3=0x20

8 years agoReplace some references to KERNPHYSADDR with the equivelent value passed in
Ian Lepore [Mon, 21 Dec 2015 01:14:54 +0000 (01:14 +0000)]
Replace some references to KERNPHYSADDR with the equivelent value passed in
from the bootloader.

8 years agoChange KERNVIRTADDR to 0xc0000000 since the low-order bits no longer need to
Ian Lepore [Sun, 20 Dec 2015 23:38:14 +0000 (23:38 +0000)]
Change KERNVIRTADDR to 0xc0000000 since the low-order bits no longer need to
match the physical load address.  Remove the *PHYSADDR symbols which are no
longer necessary.

Also remove a bunch of comments, most of which which have been wrong for
quite some time now, and the rest of which are mooted by these changes.  All
that's left in this file is assigning a single symbol to its cannonical
value, not much to comment on anymore.

8 years agoAllow armv4/5 kernels to be loaded on any 2MB boundary, like armv6/7.
Ian Lepore [Sun, 20 Dec 2015 23:31:11 +0000 (23:31 +0000)]
Allow armv4/5 kernels to be loaded on any 2MB boundary, like armv6/7.

This eliminates the reliance on PHYSADDR and KERNPHYSADDR compile-time
symbols (except when the rom-copy code is enabled) by using the current
PC and the assumption that the entry-point routine is in the first 1MB
section of the text segment.

Other cleanups done:

 - Reduce the initarm() stack size back to 2K.  It got increased to
   4 * 2K when this file was supporting multicore armv6, but that
   support is now in locore-v6.S.

 - When building the temporary startup page tables, map the entire
   4GB address space as VA=PA before mapping the kernel at its loaded
   location.  This allows access to boot parameters stored somewhere
   in ram by the bootloader, regardless of where that may be.

 - When building the page table entry for supporting EARLY_PRINTF, map
   the section as uncached unbuffered, since it is presumably device
   registers.

Note that this restores the ability to use loader(8)/ubldr on armv4/5
kernels.  That was broken in r283035, the point at which ubldr started
loading an arm kernel at any 2MB boundary.

Also note that after this, there is no reason to set KERNVIRTADDR to
anything other than 0xc0000000, and no need for PHYSADDR or KERNPHYSADDR
symbols at all.

8 years agoMerge from contrib/openbsm to bring the kernel audit bits up to date with OpenBSM...
Christian Brueffer [Sun, 20 Dec 2015 23:22:04 +0000 (23:22 +0000)]
Merge from contrib/openbsm to bring the kernel audit bits up to date with OpenBSM 1.2 alpha 4:

- remove $P4$
- fix a comment

8 years agolibc: Use namespace.h in a few more files.
Jilles Tjoelker [Sun, 20 Dec 2015 23:05:20 +0000 (23:05 +0000)]
libc: Use namespace.h in a few more files.

libc now no longer calls fstat(), socketpair() and wait(), only the
underscore-prefixed versions (_waitpid() instead of wait()).

8 years agoTidy up mips ofw_machdep.h. Don't include openfirm.h because openfirm.h
Ian Lepore [Sun, 20 Dec 2015 19:09:12 +0000 (19:09 +0000)]
Tidy up mips ofw_machdep.h.  Don't include openfirm.h because openfirm.h
is what includes machine/ofw_machdep.h.  Don't declare OF_decode_addr();
it isn't implemented yet on mips and the declaration for it is about to
be commonized into openfirm.h.

8 years agoDon't assume checksums will be calculated later when fastfoward is
Cy Schubert [Sun, 20 Dec 2015 18:02:13 +0000 (18:02 +0000)]
Don't assume checksums will be calculated later when fastfoward is
enabled (by default in r290383).

PR: 72210
MFC after: 1 week

8 years agosh/mknodes: Close files and check for errors when writing.
Jilles Tjoelker [Sun, 20 Dec 2015 16:40:36 +0000 (16:40 +0000)]
sh/mknodes: Close files and check for errors when writing.

This is a build tool only and does not affect run time.

PR: 204951
MFC after: 1 week

8 years agolibthr: Don't use both __sys_open() and __sys_openat().
Jilles Tjoelker [Sun, 20 Dec 2015 16:33:56 +0000 (16:33 +0000)]
libthr: Don't use both __sys_open() and __sys_openat().

8 years agoloader.efi: refresh size in GetMemoryMap retry loop
Ed Maste [Sun, 20 Dec 2015 16:07:09 +0000 (16:07 +0000)]
loader.efi: refresh size in GetMemoryMap retry loop

If ExitBootServices fails due to a changed efi_mapkey then GetMemoryMap
must be called again. In this case it is also possible for the memory
map to grow, so repeat the initial GetMemoryMap call to fetch the new
size.

Also roll bi_add_efi_data_and_exit into bi_load_efi_data as there's no
need for it to be a separate function.

PR: 202455
Reported by: Berislav Purgar <bpurgar@gmail.com>
Tested by: Berislav Purgar <bpurgar@gmail.com>
Reviewed by: kib
MFC after: 1 week
MFC with: r292338
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4621

8 years agoaddrinfo.ai_family is an address family, not a protocol family.
Hajimu UMEMOTO [Sun, 20 Dec 2015 15:18:50 +0000 (15:18 +0000)]
addrinfo.ai_family is an address family, not a protocol family.

PR: 162434
MFC after: 1 week

8 years agoclock_gettime(2),gettimeofday(2): Remove [EFAULT] error.
Jilles Tjoelker [Sun, 20 Dec 2015 15:11:11 +0000 (15:11 +0000)]
clock_gettime(2),gettimeofday(2): Remove [EFAULT] error.

Depending on system configuration and parameters, clock_gettime() and
gettimeofday() may not be system calls. If so, passing an invalid pointer
will cause a signal and not an [EFAULT] error.

From a standards perspective, this is OK since passing an invalid pointer is
undefined behaviour.

MFC after: 1 week

8 years agoRestore a day of the week in date(1) output for Japanese locales.
Hajimu UMEMOTO [Sun, 20 Dec 2015 14:59:30 +0000 (14:59 +0000)]
Restore a day of the week in date(1) output for Japanese locales.
It was lost by recent locale change.

8 years agoFix lockf(3) cancellation behaviour.
Konstantin Belousov [Sun, 20 Dec 2015 11:55:39 +0000 (11:55 +0000)]
Fix lockf(3) cancellation behaviour.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoClean up Kyuafile.tmp, not Kyuafile.auto.tmp
Enji Cooper [Sun, 20 Dec 2015 06:29:03 +0000 (06:29 +0000)]
Clean up Kyuafile.tmp, not Kyuafile.auto.tmp

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 agoDocument LOCALBASE in the bsd.test.mk section
Enji Cooper [Sun, 20 Dec 2015 06:27:36 +0000 (06:27 +0000)]
Document LOCALBASE in the bsd.test.mk section

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 ago- Use LOCALBASE instead of KYUA_PREFIX for the --prefix to kyua(1)
Enji Cooper [Sun, 20 Dec 2015 06:26:15 +0000 (06:26 +0000)]
- Use LOCALBASE instead of KYUA_PREFIX for the --prefix to kyua(1)
- Use LOCALBASE instead of hardcoding /usr/local for perl

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 agoDeal with another hardcoded reference to Kyuafile in the KYUAFILE == auto
Enji Cooper [Sun, 20 Dec 2015 06:01:53 +0000 (06:01 +0000)]
Deal with another hardcoded reference to Kyuafile in the KYUAFILE == auto
case

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 agoAlways expose LOCALBASE, not just when CROSS_TOOLCHAIN is defined
Enji Cooper [Sun, 20 Dec 2015 05:52:03 +0000 (05:52 +0000)]
Always expose LOCALBASE, not just when CROSS_TOOLCHAIN is defined

Instead of using which(1) to look for doxygen, look for it in <LOCALBASE>/bin .
$PATH gets mangled by make buildenv, etc so it's better to just be explicit
about the path if someone uses that for instance.

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 agoFix typo in r292500 by adding missing conditional statement
Enji Cooper [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
Enji Cooper [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.
Mark Johnston [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
Enji Cooper [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) [*]
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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 [*]
Enji Cooper [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
Enji Cooper [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"
Conrad Meyer [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
Enji Cooper [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
Enji Cooper [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
Enji Cooper [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
Jonathan T. Looney [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
Oleksandr Tymoshenko [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
Enji Cooper [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"
Conrad Meyer [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
Warner Losh [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
Warner Losh [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
Warner Losh [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
Warner Losh [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
Alan Cox [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
Baptiste Daroussin [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
Baptiste Daroussin [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
Baptiste Daroussin [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.
Hajimu UMEMOTO [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
Nathan Whitehorn [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
Pedro F. Giffuni [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
Pedro F. Giffuni [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
Baptiste Daroussin [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).
Hajimu UMEMOTO [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().
Hajimu UMEMOTO [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).
Hajimu UMEMOTO [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().
John Baldwin [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
Ed Maste [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
Hajimu UMEMOTO [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
Mateusz Guzik [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
Nathan Whitehorn [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
Warner Losh [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.
Hajimu UMEMOTO [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).
Christian 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.
Christian 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.
Christian 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
Warner Losh [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
Warner Losh [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.
Warner Losh [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 Chadd [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.
Warner Losh [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.
Warner Losh [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 Lepore [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 Lepore [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
Conrad Meyer [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.
Gleb Smirnoff [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
John Baldwin [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
John Baldwin [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.
Dag-Erling Smørgrav [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
Ruslan Bukin [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
Conrad Meyer [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 Turner [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
Steven Hartland [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.
Christian 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
George V. Neville-Neil [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.
Mark Johnston [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.
Mark Johnston [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.
Gleb Smirnoff [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