]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoAvoid taking the lock in selfdfree when not needed.
Mateusz Guzik [Thu, 23 Oct 2014 15:35:47 +0000 (15:35 +0000)]
Avoid taking the lock in selfdfree when not needed.

9 years agoChange the code to use the openpty(3) API which uses the pts(4) driver
Maksim Yevmenkin [Thu, 23 Oct 2014 15:16:40 +0000 (15:16 +0000)]
Change the code to use the openpty(3) API which uses the pts(4) driver
instead of the pty(4) driver.

PR: 184597
Submitted by: tobias.rehbein
MFC after: 2 weeks

9 years agoMove if_get_counter initialization from if_attach into if_alloc.
Andrey V. Elsukov [Thu, 23 Oct 2014 14:29:52 +0000 (14:29 +0000)]
Move if_get_counter initialization from if_attach into if_alloc.
Also, initialize all counters before ifnet will become available in the system.
This fixes possible access to uninitialized ifned fields.

PR: 194550

9 years agoFix a bug where some DTS layouts could cause the premature ending of the
Luiz Otavio O Souza [Thu, 23 Oct 2014 13:47:19 +0000 (13:47 +0000)]
Fix a bug where some DTS layouts could cause the premature ending of the
search (i.e. without returning any result) and you would end up with a
random MAC address.

Change the search algorithm to a recursive one to ensure that all the nodes
on DTS will be verified.

The previous algorithm could not keep up if the DTS has too many sub-nodes.

While here, fix the punctuation on comments.

9 years agovt(4): Add PIO_VFONT_DEFAULT ioctl to restore the default builtin font
Jean-Sébastien Pédron [Thu, 23 Oct 2014 12:38:05 +0000 (12:38 +0000)]
vt(4): Add PIO_VFONT_DEFAULT ioctl to restore the default builtin font

To restore the default font using vidcontrol(1), use the "-f" flag
without an argument:
    vidcontrol -f < /dev/ttyv0

PR: 193910
Differential Revision: https://reviews.freebsd.org/D971
Submitted by: Marcin Cieslak <saper@saper.info>
Reviewed by: ray@, emaste@
Approved by: ray@
MFC after: 1 week

9 years agoClean up (refactor) discovery a little; no functional changes.
Edward Tomasz Napierala [Thu, 23 Oct 2014 12:02:27 +0000 (12:02 +0000)]
Clean up (refactor) discovery a little; no functional changes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoShow SFP+/QSFP memory map dump on higher verbose levels.
Alexander V. Chernikov [Thu, 23 Oct 2014 11:01:49 +0000 (11:01 +0000)]
Show SFP+/QSFP memory map dump on higher verbose levels.

Sponsored by: Yandex LLC
MFC after: 1 week

9 years agoOmit the mprotect_exec testcase on FreeBSD
Enji Cooper [Thu, 23 Oct 2014 08:29:09 +0000 (08:29 +0000)]
Omit the mprotect_exec testcase on FreeBSD

Sponsored by: EMC / Isilon Storage Division

9 years agoMark signum __unused
Enji Cooper [Thu, 23 Oct 2014 08:13:07 +0000 (08:13 +0000)]
Mark signum __unused

Sponsored by: EMC / Isilon Storage Division

9 years agoFix a typo (__FreeBSD__ -> __NetBSD__ when omitting setrlimit_nthr)
Enji Cooper [Thu, 23 Oct 2014 08:12:31 +0000 (08:12 +0000)]
Fix a typo (__FreeBSD__ -> __NetBSD__ when omitting setrlimit_nthr)

9 years agoAdd limits.h #include for SSIZE_MAX
Enji Cooper [Thu, 23 Oct 2014 08:06:34 +0000 (08:06 +0000)]
Add limits.h #include for SSIZE_MAX

Sponsored by: EMC / Isilon Storage Division

9 years agoAdd limits.h #include for SSIZE_MAX
Enji Cooper [Thu, 23 Oct 2014 08:05:47 +0000 (08:05 +0000)]
Add limits.h #include for SSIZE_MAX

Sponsored by: EMC / Isilon Storage Division

9 years ago- Omit setrlimit_nthr testcase on FreeBSD (requires lwp.h, et al)
Enji Cooper [Thu, 23 Oct 2014 08:05:03 +0000 (08:05 +0000)]
- Omit setrlimit_nthr testcase on FreeBSD (requires lwp.h, et al)
- Expect overflow with rlim_max at INT64_MAX, not UINT64_MAX (rlim_t is int64_t
on FreeBSD)

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

9 years ago- Mark sig/signo __unused
Enji Cooper [Thu, 23 Oct 2014 07:59:59 +0000 (07:59 +0000)]
- Mark sig/signo __unused
- Do not provide a relative path via #include "h_macros.h"

Sponsored by: EMC / Isilon Storage Division

9 years agoUse <atf_srcdir>/truncate_test.root_owned instead of /usr/bin/fpr as fpr does
Enji Cooper [Thu, 23 Oct 2014 07:54:46 +0000 (07:54 +0000)]
Use <atf_srcdir>/truncate_test.root_owned instead of /usr/bin/fpr as fpr does
not exist on FreeBSD

truncate_test.root_owned will be generated at build time and owned by root

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoAdd limits.h #include for INT_MAX
Enji Cooper [Thu, 23 Oct 2014 07:22:18 +0000 (07:22 +0000)]
Add limits.h #include for INT_MAX

Sponsored by: EMC / Isilon Storage Division

9 years ago- Omit the poll testcases on FreeBSD (they require pollts)
Enji Cooper [Thu, 23 Oct 2014 07:20:35 +0000 (07:20 +0000)]
- Omit the poll testcases on FreeBSD (they require pollts)
- Add necessary headers for the testcases

Sponsored by: EMC / Isilon Storage Division

9 years agoMark signo __unused in handler(..)
Enji Cooper [Thu, 23 Oct 2014 07:11:58 +0000 (07:11 +0000)]
Mark signo __unused in handler(..)

Sponsored by: EMC / Isilon Storage Division

9 years agoOmit all of the testcases as revoke(2) is only implemented on devfs(5)
Enji Cooper [Thu, 23 Oct 2014 07:07:35 +0000 (07:07 +0000)]
Omit all of the testcases as revoke(2) is only implemented on devfs(5)

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoOmit the pollts testcases on FreeBSD
Enji Cooper [Thu, 23 Oct 2014 07:05:14 +0000 (07:05 +0000)]
Omit the pollts testcases on FreeBSD

Sponsored by: EMC / Isilon Storage Division

9 years agoPort t_mmap.c to FreeBSD
Enji Cooper [Thu, 23 Oct 2014 06:42:53 +0000 (06:42 +0000)]
Port t_mmap.c to FreeBSD

- Add needed headers for the testcases
- Omit mmap_block on non-NetBSD OSes
- Use "security.bsd.map_at_zero" instead of "vm.user_va0_disable"

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoAdd sys/socket.h #include for struct sockaddr_in
Enji Cooper [Thu, 23 Oct 2014 06:35:19 +0000 (06:35 +0000)]
Add sys/socket.h #include for struct sockaddr_in

Sponsored by: EMC / Isilon Storage Division

9 years agoAdd limits.h #include for LINE_MAX
Enji Cooper [Thu, 23 Oct 2014 06:25:52 +0000 (06:25 +0000)]
Add limits.h #include for LINE_MAX

Sponsored by: EMC / Isilon Storage Division

9 years ago- Mark unused parameters __unused in handler
Enji Cooper [Thu, 23 Oct 2014 06:24:36 +0000 (06:24 +0000)]
- Mark unused parameters __unused in handler
- Call sigqueue with getpid() instead of 0 -- the latter idiom appears to only
be valid on NetBSD

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoConvert "fcntl(n, F_CLOSEM)" to "closefrom(n)"
Enji Cooper [Thu, 23 Oct 2014 06:21:10 +0000 (06:21 +0000)]
Convert "fcntl(n, F_CLOSEM)" to "closefrom(n)"

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoPort t_pipe2.c to FreeBSD
Enji Cooper [Thu, 23 Oct 2014 06:18:28 +0000 (06:18 +0000)]
Port t_pipe2.c to FreeBSD

- Omit the pipe2_nosigpipe testcase on FreeBSD (FreeBSD doesn't have
  O_NOSIGPIPE).
- Convert "fcntl(n, F_CLOSEM)" to "closefrom(n)".
- Save and restore the resource limit on the number of files (RLIMIT_NOFILE).

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoExpect getgroups_err to fail on FreeBSD
Enji Cooper [Thu, 23 Oct 2014 05:58:02 +0000 (05:58 +0000)]
Expect getgroups_err to fail on FreeBSD

PR: 189941
Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoAdd netinet/in.h for struct sockaddr_in
Enji Cooper [Thu, 23 Oct 2014 05:46:10 +0000 (05:46 +0000)]
Add netinet/in.h for struct sockaddr_in

Sponsored by: EMC / Isilon Storage Division

9 years agoAdd VirtIO console driver
Bryan Venteicher [Thu, 23 Oct 2014 04:47:32 +0000 (04:47 +0000)]
Add VirtIO console driver

Support for the multiport feature is mostly implemented, but currently
disabled due to some potential races in the hot plug code paths.

Requested by: marcel
MFC after: 1 month
Relnotes: yes

9 years agoUnconditionally enable the clocks for all imx6 devices that we have drivers
Ian Lepore [Thu, 23 Oct 2014 03:13:14 +0000 (03:13 +0000)]
Unconditionally enable the clocks for all imx6 devices that we have drivers
for, or that are required to run the chip (such as busses).  Turn off all
the devices we don't yet have drivers for.

Some day we will have a fully functional imx6 clock driver so that we can
manage clocks based on fdt data.  This will have to do until then.

9 years agoSync with NetBSD.
Xin LI [Thu, 23 Oct 2014 01:22:29 +0000 (01:22 +0000)]
Sync with NetBSD.

MFC after: 2 weeks

9 years agoMFV r273494: xz 5.0.7.
Xin LI [Thu, 23 Oct 2014 00:40:56 +0000 (00:40 +0000)]
MFV r273494: xz 5.0.7.

MFC after: 2 weeks

9 years agoVendor import of xz 5.0.7.
Xin LI [Thu, 23 Oct 2014 00:33:25 +0000 (00:33 +0000)]
Vendor import of xz 5.0.7.

9 years agoMFV r273492: remove gettext files.
Xin LI [Thu, 23 Oct 2014 00:31:26 +0000 (00:31 +0000)]
MFV r273492: remove gettext files.

9 years agoRemove gettext files as we don't enable NLS.
Xin LI [Thu, 23 Oct 2014 00:09:16 +0000 (00:09 +0000)]
Remove gettext files as we don't enable NLS.

9 years agoPopulate the GELI passphrase cache with the kern.geom.eli.passphrase
Colin Percival [Wed, 22 Oct 2014 23:41:15 +0000 (23:41 +0000)]
Populate the GELI passphrase cache with the kern.geom.eli.passphrase
variable (if any) provided in the boot environment.  Unset it from
the kernel environment after doing this, so that the passphrase is
no longer present in kernel memory once we enter userland.

This will make it possible to provide a GELI passphrase via the boot
loader; FreeBSD's loader does not yet do this, but GRUB (and PCBSD)
will have support for this soon.

Tested by: kmoore

9 years agoFix some buglets in the error-handling of getdevice(). In particular, report
Mark Johnston [Wed, 22 Oct 2014 23:35:56 +0000 (23:35 +0000)]
Fix some buglets in the error-handling of getdevice(). In particular, report
an error if the argument to pciconf -a doesn't have a unit number, rather
than triggering an assertion failure.

PR: 194506
Reported by: Anthony Cornehl <accornehl@gmail.com>
Sponsored by: EMC / Isilon Storage Division

9 years agoAvoid leaking data from the kernel environment: When we convert the
Colin Percival [Wed, 22 Oct 2014 23:35:32 +0000 (23:35 +0000)]
Avoid leaking data from the kernel environment: When we convert the
initial static environment to a dynamic one, zero the static environment
buffer, and zero individual values when kern_unsetenv and freeenv are
called.

Tested by: kmoore (VM memory dump + grep)
Tested by: cperciva (kernel panic dump + grep)

9 years agoClip the settings for the NFS rsize, wsize mount options
Rick Macklem [Wed, 22 Oct 2014 22:27:51 +0000 (22:27 +0000)]
Clip the settings for the NFS rsize, wsize mount options
to a power of 2. For non-power of 2 settings, intermittent
page faults have been reported. Although the bug that causes
these page faults/crashes has not been identified, it does
not appear to occur when rsize, wsize is a power of 2.

Reported by: tcberner@gmail.com
MFC after: 2 weeks

9 years agoRevert r273481 so it can be recoded using fls(), which
Rick Macklem [Wed, 22 Oct 2014 21:57:35 +0000 (21:57 +0000)]
Revert r273481 so it can be recoded using fls(), which
some feel will make it more readable.

9 years agoRename log2 to tal_log2.
Alexander V. Chernikov [Wed, 22 Oct 2014 21:20:37 +0000 (21:20 +0000)]
Rename log2 to tal_log2.

Submitted by: luigi

9 years agoThe NetBSD libc tests use several definitions/macros that aren't available in
Enji Cooper [Wed, 22 Oct 2014 21:04:54 +0000 (21:04 +0000)]
The NetBSD libc tests use several definitions/macros that aren't available in
FreeBSD

Add the missing compat definitions/macros to lib/libnetbsd so the testcases
can be compiled with libnetbsd without having to invent ad hoc #define's, or
having to convert things over to FreeBSD idioms

Reviewed by: brooks
Phabric: D993
Sponsored by: EMC / Isilon Storage Division

9 years agoClip the settings for the NFS rsize, wsize mount options
Rick Macklem [Wed, 22 Oct 2014 20:47:11 +0000 (20:47 +0000)]
Clip the settings for the NFS rsize, wsize mount options
to a power of 2. For non-power of 2 settings, intermittent
page faults have been reported. Although the bug that causes
these page faults/crashes has not been identified, it does
not appear to occur when rsize, wsize is a power of 2.

Reported by: tcberner@gmail.com
MFC after: 2 weeks

9 years agocxgbe/iw_cxgbe: wake up waiters after flushing the qp.
Navdeep Parhar [Wed, 22 Oct 2014 18:55:44 +0000 (18:55 +0000)]
cxgbe/iw_cxgbe: wake up waiters after flushing the qp.

Obtained from: Chelsio

9 years agosince we cast a pointer, use the correct signedness
Luigi Rizzo [Wed, 22 Oct 2014 18:55:36 +0000 (18:55 +0000)]
since we cast a pointer, use the correct signedness
(this was already in, and got lost in a recent update).

9 years agoFix linking static test binaries with atf.test.mk
Enji Cooper [Wed, 22 Oct 2014 18:11:10 +0000 (18:11 +0000)]
Fix linking static test binaries with atf.test.mk

Check for -static in LDFLAGS or LDFLAGS.<test>, then pass in the appropriate
dependency (LIBATF or LDATF)

This unbreaks the build with some of the NetBSD tests that need to be compiled
statically

Reviewed by: imp, jmmv
Phabric: D991
Sponsored by: EMC / Isilon Storage Division

9 years agonetback: change xnb naming convention
Roger Pau Monné [Wed, 22 Oct 2014 17:09:12 +0000 (17:09 +0000)]
netback: change xnb naming convention

Current FreeBSD netback names the interface with xnb<device unit>, but
this is not suitable for usage with the Xen toolstack, which expects
something similar to <prefix><domid><handle>. In order to solve this,
change the netback naming convention to use xnb<domid>.<handle>.

Sponsored by: Citrix Systems R&D

dev/xen/netback/netback.c:
 - Change netback to use the nomenclature stated above.

9 years agoxen: implement the privcmd user-space device
Roger Pau Monné [Wed, 22 Oct 2014 17:07:20 +0000 (17:07 +0000)]
xen: implement the privcmd user-space device

This device is only attached to priviledged domains, and allows the
toolstack to interact with Xen. The two functions of the privcmd
interface is to allow the execution of hypercalls from user-space, and
the mapping of foreign domain memory.

Sponsored by: Citrix Systems R&D

i386/include/xen/hypercall.h:
amd64/include/xen/hypercall.h:
 - Introduce a function to make generic hypercalls into Xen.

xen/interface/xen.h:
xen/interface/memory.h:
 - Import the new hypercall XENMEM_add_to_physmap_range used by
   auto-translated guests to map memory from foreign domains.

dev/xen/privcmd/privcmd.c:
 - This device has the following functions:
   - Allow user-space applications to make hypercalls into Xen.
   - Allow user-space applications to map memory from foreign domains,
     this is accomplished using the newly introduced hypercall
     (XENMEM_add_to_physmap_range).

xen/privcmd.h:
 - Public ioctl interface for the privcmd device.

x86/xen/hvm.c:
 - Remove declaration of hypercall_page, now it's declared in
   hypercall.h.

conf/files:
 - Add the privcmd device to the build process.

9 years agoxen: add a Xen to BSD error translation
Roger Pau Monné [Wed, 22 Oct 2014 16:58:52 +0000 (16:58 +0000)]
xen: add a Xen to BSD error translation

Since Xen and FreeBSD error codes are completely different add a
translation layer in order to convert Xen error codes into native
FreeBSD error codes. This will be used by the privcmd device, which
needs to return the hypercall errors into user-space.

Sponsored by: Citrix Systems R&D

xen/error.h:
 - Import Xen error codes.
 - Create a table to map Xen error codes into FreeBSD native error
   codes.
 - Create an inline function that performs the translation.

9 years agoxen: import a proper event channel user-space device
Roger Pau Monné [Wed, 22 Oct 2014 16:57:11 +0000 (16:57 +0000)]
xen: import a proper event channel user-space device

The user-space event channel device is used by applications to receive
and send event channel interrupts. This device is based on the Linux
evtchn device.

Sponsored by: Citrix Systems R&D

xen/evtchn/evtchn_dev.c:
 - Remove the old event channel device, which was already disabled in
   the build system.

dev/xen/evtchn/evtchn_dev.c:
 - Import a new event channel device based on the one present in
   Linux.
 - This device allows the following operations:
   - Bind VIRQ event channels (ioctl).
   - Bind regular event channels (ioctl).
   - Create and bind new event channels (ioctl).
   - Unbind event channels (ioctl).
   - Send notifications to event channels (ioctl).
   - Reset the device shared memory ring (ioctl).
   - Unmask event channels (write).
   - Receive event channel upcalls (read).
 - The new code is MP safe, and can be used concurrently.

conf/files:
 - Add the new device to the build system.

9 years agoxen: allow to register event channels without handlers
Roger Pau Monné [Wed, 22 Oct 2014 16:51:52 +0000 (16:51 +0000)]
xen: allow to register event channels without handlers

This is needed by the event channel user-space device, that requires
registering event channels without unmasking them. intr_add_handler
will unconditionally unmask the event channel, so we avoid calling it
if no filter/handler is provided, and then the user will be in charge
of calling it when ready.

In order to do this, we need to change the opaque type
xen_intr_handle_t to contain the event channel port instead of the
opaque cookie returned by intr_add_handler, since now registration of
event channels without handlers are allowed. The cookie will now be
stored inside of the private xenisrc struct. Also, introduce a new
function called xen_intr_add_handler that allows adding a
filter/handler after the event channel has been registered.

Sponsored by: Citrix Systems R&D

x86/xen/xen_intr.c:
 - Leave the event channel without a handler if no filter/handler is
   provided to xen_intr_bind_isrc.
 - Don't perform an evtchn_mask_port, intr_add_handler will already do
   it.
 - Change the opaque type xen_intr_handle_t to contain a pointer to
   the event channel port number, and make the necessary changes to
   related functions.
 - Introduce a new function called xen_intr_add_handler that can be
   used to add filter/handlers to an event channel after registration.

xen/xen_intr.h:
 - Add prototype of xen_intr_add_handler.

9 years agoxen: fix usage of kern_getenv in PVH code
Roger Pau Monné [Wed, 22 Oct 2014 16:49:00 +0000 (16:49 +0000)]
xen: fix usage of kern_getenv in PVH code

The value returned by kern_getenv should be freed using freeenv.

Reported by: Coverity
CID: 1248852
Sponsored by: Citrix Systems R&D

9 years agoFix ctl.conf example to use proper paths to ZVOLs.
Edward Tomasz Napierala [Wed, 22 Oct 2014 11:30:56 +0000 (11:30 +0000)]
Fix ctl.conf example to use proper paths to ZVOLs.

Sponsored by: The FreeBSD Foundation

9 years agoProvide a character device allowing us to access BERI memory regions.
Ruslan Bukin [Wed, 22 Oct 2014 11:30:03 +0000 (11:30 +0000)]
Provide a character device allowing us to access BERI memory regions.

Sponsored by: DARPA, AFRL

9 years agoRemove misleading statement. Bump date.
Edward Tomasz Napierala [Wed, 22 Oct 2014 11:09:03 +0000 (11:09 +0000)]
Remove misleading statement.  Bump date.

MFC after: 1 month
Sponsored by: FreeBSD Foundation

9 years agoComment out parts about iSER; it's not implemented.
Edward Tomasz Napierala [Wed, 22 Oct 2014 11:06:05 +0000 (11:06 +0000)]
Comment out parts about iSER; it's not implemented.

Sponsored by: The FreeBSD Foundation

9 years agoRemove spurious empty line.
Edward Tomasz Napierala [Wed, 22 Oct 2014 10:53:25 +0000 (10:53 +0000)]
Remove spurious empty line.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoFix ctld(8) to not show the "auth-group <name> not assigned to any target"
Edward Tomasz Napierala [Wed, 22 Oct 2014 09:40:46 +0000 (09:40 +0000)]
Fix ctld(8) to not show the "auth-group <name> not assigned to any target"
warning for auth-groups assigned to a portal-group.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoWhitespace fixes.
Edward Tomasz Napierala [Wed, 22 Oct 2014 09:17:17 +0000 (09:17 +0000)]
Whitespace fixes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoUntangle iSCSI authentication code by splitting off the CHAP
Edward Tomasz Napierala [Wed, 22 Oct 2014 08:59:23 +0000 (08:59 +0000)]
Untangle iSCSI authentication code by splitting off the CHAP
implementation.

Reviewed by: mav@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agofiledesc assert that table size is at least 3 in fdsetugidsafety
Mateusz Guzik [Wed, 22 Oct 2014 08:56:57 +0000 (08:56 +0000)]
filedesc assert that table size is at least 3 in fdsetugidsafety

Requested by: kib

9 years agoDocument sort_io_queue sysctls/tunables.
Alexander Motin [Wed, 22 Oct 2014 08:54:10 +0000 (08:54 +0000)]
Document sort_io_queue sysctls/tunables.

MFC after: 1 week

9 years agoActually change the USB_PORT_ROOT_RESET_DELAY definition as stated in
Hans Petter Selasky [Wed, 22 Oct 2014 07:50:19 +0000 (07:50 +0000)]
Actually change the USB_PORT_ROOT_RESET_DELAY definition as stated in
the r241987 commit message, instead of having users locally overriding
the value using tunables in /boot/loader.conf .

Found by: Adam Parco
Discussed with: Nick Hibma

9 years agoAllow overspecification of SYSCTL type in external kernel modules.
Hans Petter Selasky [Wed, 22 Oct 2014 07:16:46 +0000 (07:16 +0000)]
Allow overspecification of SYSCTL type in external kernel modules.

PR: 194523
MFC after: 3 days

9 years agofix spelling of DEFAULT in comments...
John-Mark Gurney [Wed, 22 Oct 2014 06:53:55 +0000 (06:53 +0000)]
fix spelling of DEFAULT in comments...

9 years agoremove/fix old code for building ipfw and dummynet in userspace
Luigi Rizzo [Wed, 22 Oct 2014 05:21:36 +0000 (05:21 +0000)]
remove/fix old code for building ipfw and dummynet in userspace

9 years agoPlug unnecessary PRS_NEW check in kern_procctl.
Mateusz Guzik [Wed, 22 Oct 2014 04:16:09 +0000 (04:16 +0000)]
Plug unnecessary PRS_NEW check in kern_procctl.

pfind does not return processes in such state.

9 years agoMy previous commit exposed an issue as it fixed a different
Warner Losh [Wed, 22 Oct 2014 03:39:11 +0000 (03:39 +0000)]
My previous commit exposed an issue as it fixed a different
issue. lib/atf isn't a prereq_lib, since it isn't required for other
libraries to build. Remove it. The old kludge of always building it
had effectively been retired. Since we don't want to build the
libraries with the tests when we're bootstrapping, invent
MK_TESTS_SUPPORT which normally defaults to the current MK_TESTS
value, except when explicitly defined. Make lib/atf depend on it being
yes. When building the libraries set MK_TESTS to no, and
MK_TESTS_SUPPORT to the current value of MK_TESTS so that later stages
of the build work correctly. This should fix (and does for me)
people's issues with parallel builds racing between lib/atf and
libexec/atf. Since lib/atf is built during the libraries phase, the
race disappears.

9 years agoFix the kernel panic in hostap mode.
Kevin Lo [Wed, 22 Oct 2014 03:32:27 +0000 (03:32 +0000)]
Fix the kernel panic in hostap mode.
rvp->beacon_mbuf was NULL in run_update_beacon().

PR: 189405
Submitted by: Gabor Simon <gabor.simon75 at gmail.com>
MFC after: 3 days

9 years agoReduce nesting in vn_access.
Mateusz Guzik [Wed, 22 Oct 2014 01:53:00 +0000 (01:53 +0000)]
Reduce nesting in vn_access.

No functional changes.

9 years agoVirtual machines can easily have more than 16 option ROMs and
Marcel Moolenaar [Wed, 22 Oct 2014 01:37:32 +0000 (01:37 +0000)]
Virtual machines can easily have more than 16 option ROMs and
when that happens, we happily access our resource array out of
bounds. Make sure we stay within the MAX_ROMS limit.
While here, bump MAX_ROMS from 16 to 32 to minimize the chance
of leaving option ROMs unaccounted for.

Obtained from: Juniper Networks, Inc.

9 years agoAdd defines for various FIRST PARTY DMA SEND subcommands.
Warner Losh [Wed, 22 Oct 2014 01:35:30 +0000 (01:35 +0000)]
Add defines for various FIRST PARTY DMA SEND subcommands.

9 years agoAvoid crdup when possible in kern_accessat.
Mateusz Guzik [Wed, 22 Oct 2014 01:09:07 +0000 (01:09 +0000)]
Avoid crdup when possible in kern_accessat.

While here tidy up a little.

9 years agoFix the conversion macro for .note sections, broken in the case
Marcel Moolenaar [Wed, 22 Oct 2014 01:04:16 +0000 (01:04 +0000)]
Fix the conversion macro for .note sections, broken in the case
the ELF file's byte order is not the native byte order.  The
bug is that the variables holding the name and description size
are used (natively) after having been byte-swapped.  The fix is
to calculate sz from them just prior to byte-swapping.

Approved by: jkoshy@
Obtained from: Juniper Networks, Inc.

9 years agoGCC for PowerPC does not align .note sections to 4 bytes. When
Marcel Moolenaar [Wed, 22 Oct 2014 00:58:50 +0000 (00:58 +0000)]
GCC for PowerPC does not align  .note sections to 4 bytes.  When
running ctfmerge on its objects, libelf asserts as it expects
.note sections to be 4-byte aligned.  Change that expectation.

Approved by: jkoshy@
Obtained from: Juniper Networks, Inc.

9 years agofiledesc: cleanup setugidsafety a little
Mateusz Guzik [Wed, 22 Oct 2014 00:23:43 +0000 (00:23 +0000)]
filedesc: cleanup setugidsafety a little

Rename it to fdsetugidsafety for consistency with other functions.

There is no need to take filedesc lock if not closing any files.

The loop has to verify each file and we are guaranteed fdtable has space
for at least 20 fds. As such there is no need to check fd_lastfile.

While here tidy up is_unsafe.

9 years agoEliminate unnecessary memory allocation in sys_getgroups and its ibcs2 counterpart.
Mateusz Guzik [Tue, 21 Oct 2014 23:08:46 +0000 (23:08 +0000)]
Eliminate unnecessary memory allocation in sys_getgroups and its ibcs2 counterpart.

9 years agoDo not define bad_array_new_length::bad_array_new_length in libc++ anymore
Baptiste Daroussin [Tue, 21 Oct 2014 21:49:06 +0000 (21:49 +0000)]
Do not define bad_array_new_length::bad_array_new_length in libc++ anymore
when used in combinaison with libcxxrt since it is now defined there already.
This fixes building world

9 years agoBump __FreeBSD_version to track SA-14:20, SA-14:21, SA-14:22,
Glen Barber [Tue, 21 Oct 2014 21:37:53 +0000 (21:37 +0000)]
Bump __FreeBSD_version to track SA-14:20, SA-14:21, SA-14:22,
SA-14:23

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

9 years agoTake the lock shared in linker_search_symbol_name.
Mateusz Guzik [Tue, 21 Oct 2014 21:29:20 +0000 (21:29 +0000)]
Take the lock shared in linker_search_symbol_name.

This helps sysctl kern.proc.stack.

9 years agotmpfs: allow shared file lookups
Mateusz Guzik [Tue, 21 Oct 2014 21:27:13 +0000 (21:27 +0000)]
tmpfs: allow shared file lookups

Tested by: pho

9 years agoRevert r273426 r273409
Baptiste Daroussin [Tue, 21 Oct 2014 21:17:44 +0000 (21:17 +0000)]
Revert r273426 r273409

A solution that work with both new and old binutils should be investigated

9 years agoolder binutils does not know about --no-fatal-warnings
Baptiste Daroussin [Tue, 21 Oct 2014 21:09:54 +0000 (21:09 +0000)]
older binutils does not know about --no-fatal-warnings

9 years agoMark some more sysctl stuff shared-locked and MPSAFE.
Mateusz Guzik [Tue, 21 Oct 2014 21:08:45 +0000 (21:08 +0000)]
Mark some more sysctl stuff shared-locked and MPSAFE.

9 years agoUse the UAUTO SYSCTL type for exporting the bounce zone alignment,
Hans Petter Selasky [Tue, 21 Oct 2014 21:04:44 +0000 (21:04 +0000)]
Use the UAUTO SYSCTL type for exporting the bounce zone alignment,
because the variable size depends on the build type.

Reported by: kib @
MFC after: 3 days

9 years agoFix typo in src option description
Ed Maste [Tue, 21 Oct 2014 20:44:33 +0000 (20:44 +0000)]
Fix typo in src option description

9 years agoRegenerate after r273418
Ed Maste [Tue, 21 Oct 2014 20:41:19 +0000 (20:41 +0000)]
Regenerate after r273418

9 years agoFor the kernel, we have USB_GADGET_EXAMPLES as defaults to yes. For
Warner Losh [Tue, 21 Oct 2014 20:29:53 +0000 (20:29 +0000)]
For the kernel, we have USB_GADGET_EXAMPLES as defaults to yes. For
userland defaults to no. This caused issues for the automated option
documenation script. Turns out, this isn't used in userland at all, so
just remove it from here.

9 years agoGenerate both userland and kernel option settings for showconfig.
Warner Losh [Tue, 21 Oct 2014 20:29:51 +0000 (20:29 +0000)]
Generate both userland and kernel option settings for showconfig.

PR: 191920

9 years agoYou aren't allowed to test WITH_xxx or WITHOUT_xxx here, so remove it.
Warner Losh [Tue, 21 Oct 2014 20:29:42 +0000 (20:29 +0000)]
You aren't allowed to test WITH_xxx or WITHOUT_xxx here, so remove it.
Even if you were allowed to test for it, the test makes no sense as it
always results in adding -DWITH_ATF unless WITH_ATF was already
defined. But if MK_ATF != no, then we know it was defined. This, in
turn, caused tools/build/options/makemake always think WITH_ATF is the
default, which removed control of that from sys.conf.mk.

To get the intent of the deleted comment, another mechanism is
required, assuming that the intent of that comment is desirable.

9 years agoAdd sys/socket.h #include for bind(2), et al
Enji Cooper [Tue, 21 Oct 2014 20:17:05 +0000 (20:17 +0000)]
Add sys/socket.h #include for bind(2), et al

Sponsored by: EMC / Isilon Storage Division

9 years agoDo not make ld(1) warnings fatal anymore, binutils behaviour has changed over the
Baptiste Daroussin [Tue, 21 Oct 2014 20:11:05 +0000 (20:11 +0000)]
Do not make ld(1) warnings fatal anymore, binutils behaviour has changed over the
time and gnu.warnings.symbol are now being fatal preventing building world.

in the futur we want to investigate only making the gnu.warning.symbol non fatal

Reviewed by: imp

9 years agoMake the external toolchain support grows to the knowleged of XXFLAGS for C++ dedicat...
Baptiste Daroussin [Tue, 21 Oct 2014 20:07:15 +0000 (20:07 +0000)]
Make the external toolchain support grows to the knowleged of XXFLAGS for C++ dedicated flags
and DEPFLAGS for mkdep flags
Pass the path to the libc++ headers in both, enforce the gnu++11 standard in the XXFLAGS
to satisfy libc++ requirements pass the libc++ objectdir as a location where to find
libraries so it can find libstdc++.so and libstdc++.A

Reviewed by: imp

9 years agoWhen using an external gcc 4.8+ and not building libstdc++ then create in the objectdir a
Baptiste Daroussin [Tue, 21 Oct 2014 20:04:05 +0000 (20:04 +0000)]
When using an external gcc 4.8+ and not building libstdc++ then create in the objectdir a
fake libstdc++.so and libstdc++.a which is a symlink on libc++ that allow g++ to satisfy
its links dependencies in the least hackish way.
Please note that this hacky libstds++ never get installed on the final system

Reviewed by: imp

9 years agoAlways use libc++ as the default c++ stack when building with an external gcc 4.8+
Baptiste Daroussin [Tue, 21 Oct 2014 20:00:49 +0000 (20:00 +0000)]
Always use libc++ as the default c++ stack when building with an external gcc 4.8+
While here disable building gcc from base when using gcc 4.8+

Reviewed by: imp

9 years agoWhen using an external toolchain note that gcc 4.8+ supports C++11
Baptiste Daroussin [Tue, 21 Oct 2014 19:58:23 +0000 (19:58 +0000)]
When using an external toolchain note that gcc 4.8+ supports C++11

Submitted by: imp

9 years agoThe dependencies are computed with CC even if sources are C++, when building
Baptiste Daroussin [Tue, 21 Oct 2014 19:56:45 +0000 (19:56 +0000)]
The dependencies are computed with CC even if sources are C++, when building
when building with an external gcc, we want to be able to pass the path to
the libc++ headers so dependencies are correctly computed for C++ source files.
Add a DEPFLAGS for that purpose

Reviewed by: imp

9 years agoMake sysctl name2oid shared-locked as well.
Mateusz Guzik [Tue, 21 Oct 2014 19:45:08 +0000 (19:45 +0000)]
Make sysctl name2oid shared-locked as well.

This is a follow-up to r273401.

9 years agoFix an issue where a FreeBSD virtual machine provisioned in
Glen Barber [Tue, 21 Oct 2014 19:36:20 +0000 (19:36 +0000)]
Fix an issue where a FreeBSD virtual machine provisioned in
the Microsoft Azure service does not recognize the second
attached disk on the system.

Submitted by: kyliel@Microsoft
Patched by: weh@Microsoft
PR: 194376
MFC after: 3 days
X-MFC-10.1: yes, ASAP
Sponsored by: The FreeBSD Foundation

9 years agoImplement shared locking for sysctl.
Mateusz Guzik [Tue, 21 Oct 2014 19:05:44 +0000 (19:05 +0000)]
Implement shared locking for sysctl.