]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoRefer to creating Phabricator Herald notifications
rodrigc [Tue, 22 Dec 2015 17:46:14 +0000 (17:46 +0000)]
Refer to creating Phabricator Herald notifications

This will allow maintainers to be notified of
any reviews or commits affecting parts of the
tree which they maintain.

Reviewed by:           jhb, emaste, allanjude
Differential Revision: https://reviews.freebsd.org/D4623

8 years agoDon't adjust the program counter to an invalid address after reaching a
andrew [Tue, 22 Dec 2015 17:18:40 +0000 (17:18 +0000)]
Don't adjust the program counter to an invalid address after reaching a
breakpoint. The value doesn't need to be adjusted as it is already
correctly returned from the kernel.

This allows lldb to set breakpoints, and stop on them, however more work
is needed, for example single stepping fails to stop.

Discussed with: emaste

8 years agoFix speed setting by NVRAM for 24xx and above chips.
mav [Tue, 22 Dec 2015 17:01:30 +0000 (17:01 +0000)]
Fix speed setting by NVRAM for 24xx and above chips.

8 years ago[mips] Add TLB pagemask probing code, and print out the allowable page sizes.
adrian [Tue, 22 Dec 2015 15:59:41 +0000 (15:59 +0000)]
[mips] Add TLB pagemask probing code, and print out the allowable page sizes.

This is from Stacey's work on larger kernel stack sizes for MIPS.  Thanks!

Submitted by: sson

8 years agoUndo change from r292607 that was not meant to be there
pfg [Tue, 22 Dec 2015 15:42:53 +0000 (15:42 +0000)]
Undo change from r292607 that was not meant to be there

Pointyhat: me

8 years agocron: Check the return value of pipe(2)
pfg [Tue, 22 Dec 2015 15:32:45 +0000 (15:32 +0000)]
cron: Check the return value of pipe(2)

Fix inspired by: OpenBSD (rev 1.56)
CID: 1009830

8 years agocrontab: properly free an entry
pfg [Tue, 22 Dec 2015 15:30:26 +0000 (15:30 +0000)]
crontab: properly free an entry

This should close memory leak.

Obtained from: OpenBSD (rev. 1.62)
CID: 271773

8 years agocrontab: replace malloc + bzero with calloc
pfg [Tue, 22 Dec 2015 15:20:08 +0000 (15:20 +0000)]
crontab: replace malloc + bzero with calloc

Obtained from: OpenBSD (Rev 1.20)

8 years agoIf vnets are torn down while ifconfig runs an ioctl to say, destroy an
bz [Tue, 22 Dec 2015 15:03:45 +0000 (15:03 +0000)]
If vnets are torn down while ifconfig runs an ioctl to say, destroy an
epair(4), we may hit if_detach_internal() without holding a lock and by
the time we aquire it the interface might be gone.
We should not panic() in this case as it is our fault for not holding
the lock all the way. It is not ideal to return silently without error
to user space, but other callers will all ignore the return values so
do not change the entire KPI for little benefit for now.
The ifp will be dealt with one way or another still.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D4529

8 years agoIf bootverbose is enabled every vnet startup and virtual interface
bz [Tue, 22 Dec 2015 15:00:04 +0000 (15:00 +0000)]
If bootverbose is enabled every vnet startup and virtual interface
creation will print extra lines on the console. We are generally not
interested in this (repeated) information for each VNET. Thus only
print it for the default VNET. Virtual interfaces on the base system
will remain printing information, but e.g. each loopback in each vnet
will no longer cause a "bpf attached" line.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D4531

8 years agoSimplify bringup order by removing a SYSINIT making it a static list
bz [Tue, 22 Dec 2015 14:57:04 +0000 (14:57 +0000)]
Simplify bringup order by removing a SYSINIT making it a static list
initialization.

Mfp4 @180384,180385:

  There is no need for a dedicated SYSINIT here.  The
  list can be initialized statically.

  Sponsored by: CK Software GmbH
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D4528

8 years agoSince r256624 we've been leaking routing table allocations
bz [Tue, 22 Dec 2015 14:53:19 +0000 (14:53 +0000)]
Since r256624 we've been leaking routing table allocations
on vnet enabled jail shutdown. Call the provided cleanup
routines for IP versions 4 and 6 to plug these leaks.

Sponsored by: The FreeBSD Foundation
MFC atfer: 2 weeks
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D4530

8 years agoFix a panic when launching VNETs after the commit of r292309.
jtl [Tue, 22 Dec 2015 13:41:50 +0000 (13:41 +0000)]
Fix a panic when launching VNETs after the commit of r292309.

Differential Revision: https://reviews.freebsd.org/D4645
Reviewed by: rrs
Reported by: kp
Tested by: kp
Sponsored by: Juniper Networks

8 years agoWe don't need to use a temporary buffer, here.
ume [Tue, 22 Dec 2015 12:01:06 +0000 (12:01 +0000)]
We don't need to use a temporary buffer, here.

MFC after: 1 week

8 years agoMake CUSE usable with platforms where the size of "unsigned long" is
hselasky [Tue, 22 Dec 2015 09:55:44 +0000 (09:55 +0000)]
Make CUSE usable with platforms where the size of "unsigned long" is
different from the size of a pointer.

8 years agoMake CUSE usable with platforms where the size of "unsigned long" is
hselasky [Tue, 22 Dec 2015 09:41:33 +0000 (09:41 +0000)]
Make CUSE usable with platforms where the size of "unsigned long" is
different from the size of a pointer.

8 years agoGuard against the same process being both CUSE server and client at
hselasky [Tue, 22 Dec 2015 09:26:24 +0000 (09:26 +0000)]
Guard against the same process being both CUSE server and client at
the same time. This can easily lead to a deadlock when destroying the
character devices nodes.

8 years agoRemove the arm KERNPHYSADDR option as it is no longer used. The make
andrew [Tue, 22 Dec 2015 09:08:21 +0000 (09:08 +0000)]
Remove the arm KERNPHYSADDR option as it is no longer used. The make
option is still in existance as it is used to build the trampoline code.

8 years agoFor embedded platforms that require it, use mtools to copy the
imp [Tue, 22 Dec 2015 06:36:00 +0000 (06:36 +0000)]
For embedded platforms that require it, use mtools to copy the
appropriate u-boot port's files into the fat part.

8 years agoPrevent use-after-free with ctx->ns in set_nameservers(..), which could occur
ngie [Tue, 22 Dec 2015 05:57:23 +0000 (05:57 +0000)]
Prevent use-after-free with ctx->ns in set_nameservers(..), which could occur
if the memory wasn't allocated again later on

Reported by: Coverity
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoSet env vars from values on the efi loader command line.
ian [Tue, 22 Dec 2015 03:07:38 +0000 (03:07 +0000)]
Set env vars from values on the efi loader command line.

Examine each cmdline arg and if it contains an '=' convert it to ascii and
pass it to putenv(). This allows var=value settings to come in on the
command line.

This will allow overriding dhcp server-provided data in loader(8), as
discussed in PR 202098

PR: 202098
Differential Revision: https://reviews.freebsd.org/D4561

8 years agoAllow dhcp/bootp server-provided values to be overriden from environment
ian [Tue, 22 Dec 2015 03:02:52 +0000 (03:02 +0000)]
Allow dhcp/bootp server-provided values to be overriden from environment
variables in loader(8) and other libstand applications.

Sometimes a dhcp server provides incorrect information along with the IP
address. It would be useful to have a way to override this with
locally-supplied information, such as command line parameters passed from a
prior-stage bootloader. This change allows pre-existing env vars to take
precedence over values delivered by the dhcp or bootp server.

The bootp/dhcp code in libstand automatically creates environment variables
from the data provided by the server (dhcp.root-path, dhcp.domain-name,
etc). It also transcribes the values to some global variables such as
'rootpath' and 'hostname'.

This change does two things:

    When adding dhcp.* vars to the environment, don't replace existing
    vars/values.

    When setting the global vars rootpath and hostname, use the
    dhcp.root-path and dhcp.host-name env var values if they exist.

This allows the platform-specific part of loader(8) to obtain override
values in some platform-specific way and store them in the environment
before opening the network device. The set of values that can be overriden
is currently limited to just string options. The values that are delivered
as binary data are things that probably shouldn't be overridden (IP,
netmask, gateway, etc).

The original patch this evolved from was submitted by martymac@

PR: 202098
Differential Revision: https://reviews.freebsd.org/D4559

8 years agoDump out the output from flock_helper on failure so failures with the
ngie [Tue, 22 Dec 2015 02:10:31 +0000 (02:10 +0000)]
Dump out the output from flock_helper on failure so failures with the
test app can be debugged

MFC after: 1 week
Obtained from: Isilon OneFS (^/onefs/head@r511419)
Sponsored by: EMC / Isilon Storage Division

8 years agoUse stable output to a test file instead of depending on the OS name being
ngie [Tue, 22 Dec 2015 01:21:27 +0000 (01:21 +0000)]
Use stable output to a test file instead of depending on the OS name being
grep'able in /bin/sh

This fixes the situation where the OS has been rebranded to something other
than `FreeBSD`

MFC after: 1 week
Obtained from: Isilon OneFS (^/onefs/head@r511419)
Reviewed by: cem, Daniel O'Connor <darius@dons.net.au>
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd libxo support to jls
rodrigc [Tue, 22 Dec 2015 00:58:35 +0000 (00:58 +0000)]
Add libxo support to jls

PR:                    200746
Submitted by:          Emmanuel Vadot <manu bidouilliste com>
Reviewed by:           allanjude
Relnotes:              yes
Differential Revision: https://reviews.freebsd.org/D4452

8 years agoFix the detection of IO/memory space changing across busses when the bus
ian [Tue, 22 Dec 2015 00:53:19 +0000 (00:53 +0000)]
Fix the detection of IO/memory space changing across busses when the bus
is not pci (and thus where, ironically, the whole situation is meaningless).

This was not an error in the original code, it was introduced during my
refactoring to commonize the routine.  A small change a few lines above
drove the need to make this change, and the error didn't show up on the
platforms I initially tested with.

8 years agoDon't dump core files with lib/libc/ssp/ssp_test and lib/libc/gen/assert_test
ngie [Tue, 22 Dec 2015 00:43:22 +0000 (00:43 +0000)]
Don't dump core files with lib/libc/ssp/ssp_test and lib/libc/gen/assert_test

The default `sysctl kern.corefile` value is compatible with `kyua test` (FreeBSD
will dump to the current directory). If it's set to an absolute path however,
`kyua test` will not be able to clean up the corefiles after the fact

The corefiles have little value when testing the behavior of feature behavior,
so just disable corefile generation

MFC after: 1 week
Obtained from: Isilon OneFS (^/onefs/head@r511419)
Sponsored by: EMC / Isilon Storage Division

8 years agoInclude machine/_bus.h so that bus_space_[tag|handle]_t will be available.
ian [Mon, 21 Dec 2015 23:47:49 +0000 (23:47 +0000)]
Include machine/_bus.h so that bus_space_[tag|handle]_t will be available.

It appears that all platforms except aarch64 are getting the file via
various header pollution, and ensuring _bus.h is included before any
openfirmware headers in every consumer of ofw/fdt stuff seems like more of
a career path than a task, so I'm taking this easy way out.

8 years agoboot1.efi: show EFI error number, not full status value
emaste [Mon, 21 Dec 2015 22:42:03 +0000 (22:42 +0000)]
boot1.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 agortld: Use common NT_FREEBSD_* note types introduced in r291909
emaste [Mon, 21 Dec 2015 22:40:29 +0000 (22:40 +0000)]
rtld: Use common NT_FREEBSD_* note types introduced in r291909

Sponsored by: The FreeBSD Foundation

8 years agoAdd i.MX 6 IPU driver and enable it in IMX6 config
gonzo [Mon, 21 Dec 2015 22:25:35 +0000 (22:25 +0000)]
Add i.MX 6 IPU driver and enable it in IMX6 config

Current functionality is somewhat limited: driver assumes that there
is only one active IPU unit (IPU1) and that video output is DI0 and
video mode is 1024x768. For more advanced functionality driver requires
proper clock management which is work in progress. At the moment driver
assumes that pixel clock is configured by u-boot for 1026x768 mode.

Reviewed by: andrew, ian, mmel
Differential Revision: https://reviews.freebsd.org/D4168

8 years agoFix "mount -a" for NFS and ZFS filesystems with shared mountpoints
asomers [Mon, 21 Dec 2015 22:19:22 +0000 (22:19 +0000)]
Fix "mount -a" for NFS and ZFS filesystems with shared mountpoints

sbin/mount.c
Check whether an fstab entry has the same fstype as a mounted
filesystem before declaring it to be mounted. This will allow NFS
filesystems that share a mountpoint with a local filesystem to be
automatically mounted at boot.

This is not such an unusual situation. For example, if somebody uses
the standard installer with a ZFS root, he'll get a /usr/home
filesystem, even though he may choose to mount /usr/home over NFS.

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

8 years ago- Add driver for i.MX 6 HDMI framer
gonzo [Mon, 21 Dec 2015 21:40:15 +0000 (21:40 +0000)]
- Add driver for i.MX 6 HDMI framer
- Enable HDMI driver in IMX6 config

Reviewed by: andrew, ian, mmel
Differential Revision: https://reviews.freebsd.org/D4174

8 years agoIntegrate tools/regression/mac/mac_bsdextended and
ngie [Mon, 21 Dec 2015 21:24:03 +0000 (21:24 +0000)]
Integrate tools/regression/mac/mac_bsdextended and
tools/regression/mac/mac_portacl into the FreeBSD test suite as
tests/sys/mac/bsdextended and tests/sys/mac/portacl, respectively

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

8 years agoMake the mac_portacl testcases work / more robust
ngie [Mon, 21 Dec 2015 21:15:23 +0000 (21:15 +0000)]
Make the mac_portacl testcases work / more robust

- A trap(1) call has been added to the test scripts to better
  ensure that the tests do a better job at trying to restore the
  test host state at the end of the tests (if the test was
  interrupted before it would leave the system in an odd state,
  potentially making the test results for subsequent runs
  non-deterministic).
- Add root user checks
- Fix nc(1) usage:
  -- -o is deprecated
  -- Using `-w 10` will make the call timeout after 10 seconds so it
     doesn't block indefinitely
- Use local variables
- Be more terse in the error messages
- Parameterize out "127.0.0.1"

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

8 years agoRevert this change. It broke the trampoline build. Until I'm sure
imp [Mon, 21 Dec 2015 20:36:01 +0000 (20:36 +0000)]
Revert this change. It broke the trampoline build. Until I'm sure
nothing else is broken, I'm reverting.

8 years agoAdd CCM functions to enable HDMI framer and IPU units (video controller)
gonzo [Mon, 21 Dec 2015 20:17:24 +0000 (20:17 +0000)]
Add CCM functions to enable HDMI framer and IPU units (video controller)

Reviewed by: andrew, ian
Differential Revision: https://reviews.freebsd.org/D4168

8 years agoAdd port for IRC over TLS/SSL, as noted in RFC 7194.
jlh [Mon, 21 Dec 2015 20:14:40 +0000 (20:14 +0000)]
Add port for IRC over TLS/SSL, as noted in RFC 7194.

PR: 192505
Submitted by: loic.blot@unix-experience.fr
MFC after: 3 days

8 years agoloader.efi: strip trailing whitespace
emaste [Mon, 21 Dec 2015 19:56:11 +0000 (19:56 +0000)]
loader.efi: strip trailing whitespace

Sponsored by: The FreeBSD Foundation

8 years agoAs previously noted in r290409, purge old entries from MAINTAINERS.
jhb [Mon, 21 Dec 2015 19:15:06 +0000 (19:15 +0000)]
As previously noted in r290409, purge old entries from MAINTAINERS.

8 years agoStop processing of a SACK when the association has been aborted.
tuexen [Mon, 21 Dec 2015 18:52:02 +0000 (18:52 +0000)]
Stop processing of a SACK when the association has been aborted.

MFC after: 3 days

8 years agoConfigure the Atmel eval boards to boot the same way. This gives
imp [Mon, 21 Dec 2015 18:27:51 +0000 (18:27 +0000)]
Configure the Atmel eval boards to boot the same way. This gives
them the same layout as other embedded systems.

8 years agoAdd a mips implementation of OF_decode_addr().
ian [Mon, 21 Dec 2015 18:19:14 +0000 (18:19 +0000)]
Add a mips implementation of OF_decode_addr().

8 years agoImplement OF_decode_addr() for arm. Move most of powerpc's implementation
ian [Mon, 21 Dec 2015 18:07:32 +0000 (18:07 +0000)]
Implement OF_decode_addr() for arm.  Move most of powerpc's implementation
into a new function that other platforms can share.

This creates a new ofw_reg_to_paddr() function (in a new ofw_subr.c file)
that contains most of the existing ppc implementation, mostly unchanged.
The ppc code now calls the new MI code from the MD code, then creates a
ppc-specific bus_space mapping from the results. The new arm implementation
does the same in an arm-specific way.

This also moves the declaration of OF_decode_addr() from ofw_machdep.h to
openfirm.h, except on sparc64 which uses a different function signature.

This will help all FDT platforms to set up early console access using
OF_decode_addr().

8 years agoUse _map_v4v6_address().
ume [Mon, 21 Dec 2015 17:54:23 +0000 (17:54 +0000)]
Use _map_v4v6_address().

MFC after: 1 week

8 years agoMake the building of libsmb and mount_smbfs unconditional, now that r292552
ian [Mon, 21 Dec 2015 17:41:08 +0000 (17:41 +0000)]
Make the building of libsmb and mount_smbfs unconditional, now that r292552
has eliminated alignment and endian problems that were making it fail on
some platforms.

PR:        180438
PR:        189415

8 years agoAvoid unaligned memory accesses when encoding netbios names in libsmb.
ian [Mon, 21 Dec 2015 17:17:00 +0000 (17:17 +0000)]
Avoid unaligned memory accesses when encoding netbios names in libsmb.

The current code for encoding a netbios name converts each byte to a 16-bit
value and stores the result by casting a char* to u_short*, resulting in
alignment faults on strict-alignment platforms.

This change reimplements the encoding routine using only byte accesses to
memory. There is no particular reason to work with 16-bit values just
because the encoding process creates two bytes of output for every byte of
input. Working a byte at at time also avoids endian problems for big-endian
platforms.

PR: 180438
PR: 189415
Differential Revision: https://reviews.freebsd.org/D4622

8 years agoSimplify _map_v4v6_address().
ume [Mon, 21 Dec 2015 16:55:36 +0000 (16:55 +0000)]
Simplify _map_v4v6_address().

Suggested by: hrs
MFC after: 1 week

8 years agomakefs: use ENTRY macro for diff reduction with NetBSD
emaste [Mon, 21 Dec 2015 16:12:41 +0000 (16:12 +0000)]
makefs: use ENTRY macro for diff reduction with NetBSD

Sponsored by: The FreeBSD Foundation

8 years ago- Convert testcase to TAP format
ngie [Mon, 21 Dec 2015 12:43:04 +0000 (12:43 +0000)]
- Convert testcase to TAP format
- Use nitems(x) instead of handrolled sizeof(x) / sizeof(*x) macro
- Do not mark count != 0 case with bsde_get_rule_count as a failure; this
  generates false positives on systems with ugidfw rules set on it

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

8 years agoRedo the TAP integration so it works with Kyua
ngie [Mon, 21 Dec 2015 12:39:16 +0000 (12:39 +0000)]
Redo the TAP integration so it works with Kyua

Kyua needs numbers in the TAP results :/, but prove doesn't

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

8 years agoImplement drain_workqueue() function.
hselasky [Mon, 21 Dec 2015 12:20:02 +0000 (12:20 +0000)]
Implement drain_workqueue() function.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoIn the zero delay case in queue_delayed_work() use the return value
hselasky [Mon, 21 Dec 2015 12:13:03 +0000 (12:13 +0000)]
In the zero delay case in queue_delayed_work() use the return value
from taskqueue_enqueue() instead of reading "ta_pending" unlocked and
also ensure the callout is stopped before proceeding.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoMinor workqueue cleanup:
hselasky [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
kib [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
ume [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.
hselasky [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().
hselasky [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'
uqs [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
ngie [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
ngie [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
ngie [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
ngie [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,
imp [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
cem [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 [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 [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 [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 [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 [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...
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 [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 [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 [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 [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 [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
emaste [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.
ume [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 [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.
ume [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.
kib [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
ngie [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
ngie [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)
ngie [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
ngie [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
ngie [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
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