]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoFix lock leak in purely hypothetical case of TCP connection without SVC_ACK
mav [Tue, 14 Jan 2014 20:18:38 +0000 (20:18 +0000)]
Fix lock leak in purely hypothetical case of TCP connection without SVC_ACK
method.  This change should be NOP now, but it is better to be future safe.

Reported by: rmacklem

10 years agoDisable 'monitor' feature in ntpd by default.
delphij [Tue, 14 Jan 2014 18:59:00 +0000 (18:59 +0000)]
Disable 'monitor' feature in ntpd by default.

Security: FreeBSD-SA-14:02.ntpd
Approved by: so

10 years agoFix bsnmpd remote denial of service vulnerability.
delphij [Tue, 14 Jan 2014 18:58:57 +0000 (18:58 +0000)]
Fix bsnmpd remote denial of service vulnerability.

Reported by: dinoex
Submitted by: harti
Security: FreeBSD-SA-14:01.bsnmpd
Security: CVE-2014-1452

10 years agoReplace hand-crafted Kyuafiles with automatic generation.
jmmv [Tue, 14 Jan 2014 18:45:32 +0000 (18:45 +0000)]
Replace hand-crafted Kyuafiles with automatic generation.

Redo r260506 by using the new TEST_METADATA functionality of bsd.test.mk
to mark the sh(1) and test(1) tests as not supporting root.  This is to
get rid of hand-crafted Kyuafiles for these very simple cases.

MFC after: 5 days

10 years agoUse TAP_TESTS_PERL to register the legacy_test in bin/pax.
jmmv [Tue, 14 Jan 2014 18:39:30 +0000 (18:39 +0000)]
Use TAP_TESTS_PERL to register the legacy_test in bin/pax.

Redo r260586 by using the new functionality in tap.test.mk to transparently
support perl-based test programs.

As a side-effect, we get rid of an explicit path to /usr/bin/perl by
replacing it with /usr/local/bin/perl (or as defined in tap.test.mk).

This also fixes the name of the legacy_test source file because this should
have always been legacy_test.pl and not legacy_test.sh.  My mistake when
originally moving the code around without realizing that this was a perl
script.

MFC after: 5 days

10 years agoSupport perl-based TAP-compliant test programs.
jmmv [Tue, 14 Jan 2014 18:35:56 +0000 (18:35 +0000)]
Support perl-based TAP-compliant test programs.

Introduce a TAP_TESTS_PERL primitive to list test programs written in perl.
Only do this in tap.test.mk because I only expect perl-based test programs
with this interface.

This is very similar to TAP_TESTS_SH but the difference is that we record
in the Kyuafile that the test program requires a perl interpreter.  This
in turn makes Kyua mark the test as skipped if the perl package is not yet
installed, instead of mysteriously failing to run the program.

MFC after: 5 days

10 years agoSupport defining test program metadata from the Makefiles.
jmmv [Tue, 14 Jan 2014 18:32:47 +0000 (18:32 +0000)]
Support defining test program metadata from the Makefiles.

Introduce a new, per-test-program TEST_METADATA.<program> variable that
contains a list of key/value paris describing metadata properties for
that test program.  These properties are later written into the
auto-generated Kyuafile when using the KYUAFILE=auto functionality.

This is to avoid having to supply hand-crafted Kyuafiles when the needs
for metadata overrides are trivial.

While doing this, and because I am documenting TEST_METADATA, take the
chance to document the TEST_INTERFACE setting as well.

MFC after: 5 days

10 years agoDon't output any modifier keys before we see a valid
hselasky [Tue, 14 Jan 2014 08:43:38 +0000 (08:43 +0000)]
Don't output any modifier keys before we see a valid
non-modifier key press. This prevents so-called "ghost
keyboards" keeping modifier keys pressed while not
actually seen as a real keyboard.

MFC after: 2 weeks

10 years agoAdd missing EM_PPC64 to e_machine header display.
jhibbits [Tue, 14 Jan 2014 04:28:41 +0000 (04:28 +0000)]
Add missing EM_PPC64 to e_machine header display.

MFC after: 1 week

10 years agoAdd an API to rendezvous all active vcpus in a virtual machine. The rendezvous
neel [Tue, 14 Jan 2014 01:55:58 +0000 (01:55 +0000)]
Add an API to rendezvous all active vcpus in a virtual machine. The rendezvous
can be initiated in the context of a vcpu thread or from the bhyve(8) control
process.

The first use of this functionality is to update the vlapic trigger-mode
register when the IOAPIC pin configuration is changed.

Prior to this change we would update the TMR in the virtual-APIC page at
the time of interrupt delivery. But this doesn't work with Posted Interrupts
because there is no way to program the EOI_exit_bitmap[] in the VMCS of
the target at the time of interrupt delivery.

Discussed with: grehan@

10 years agoANSI-fy prototype.
delphij [Tue, 14 Jan 2014 01:52:34 +0000 (01:52 +0000)]
ANSI-fy prototype.

MFC after: 2 weeks

10 years agoMove myself from ports alumni to active ports committer section.
bmah [Mon, 13 Jan 2014 23:27:24 +0000 (23:27 +0000)]
Move myself from ports alumni to active ports committer section.
Add an edge indicating mat as my ports mentor.

Approved by: mat (mentor)

10 years agoDescribed in the man page but not implemented. Here it comes,
andreast [Mon, 13 Jan 2014 22:21:29 +0000 (22:21 +0000)]
Described in the man page but not implemented. Here it comes,
atomic_swap_32/64. The latter only for powerpc64.

MFC after: 1 month

10 years agoThe onyx codec works also as module, so add it.
andreast [Mon, 13 Jan 2014 21:44:17 +0000 (21:44 +0000)]
The onyx codec works also as module, so add it.

MFC after: 1 month

10 years agoRemove scary comment about this being a test key.
bdrewery [Mon, 13 Jan 2014 20:55:15 +0000 (20:55 +0000)]
Remove scary comment about this being a test key.

There has been no need to regenerate the signing key.

Reported by: mat
Approved by: bapt (mentor)
MFC after: 3 days

10 years agoWhen building a cross-kgdb, suppress the registration of the
marcel [Mon, 13 Jan 2014 19:08:25 +0000 (19:08 +0000)]
When building a cross-kgdb, suppress the registration of the
standard core target by declaring coreops_suppress_target with
initializer. This is also happening for non-cross kgdb, by
virtue of having fbsd-threads.c in libgdb and having it do the
exact same thing. Since fbsd-threads.c is not included in in
libgdb when building a cross debugger, we ended up with more
than 1 core file targets (the standard gdb core file target and
kgdb's libkvm based core file target) and this behaves the same
as not having a core target at all.

10 years agoWe don't have to worry about page sizes when working on virtual
marcel [Mon, 13 Jan 2014 19:02:31 +0000 (19:02 +0000)]
We don't have to worry about page sizes when working on virtual
cores (i.e. minidumps). Every segment is virtually contiguous.

10 years agoRe-apply the part of r260022 that was reverted by r260030 with
marcel [Mon, 13 Jan 2014 19:01:14 +0000 (19:01 +0000)]
Re-apply the part of r260022 that was reverted by r260030 with
one significant difference: for LIB32 builds both TARGET_ARCH
and MACHINE_ARCH are defined. TARGET_ARCH confusingly holds the
architecture of the host (e.g. amd64), while MACHINE_ARCH holds
the architecture were trying to build (e.g. i386). With both
set and different, r260022 changed the behaviour to interpret
the condition as building a cross-amd64 libkvm on i386, when
obviously we're trying to build an i386 version on amd64. When
COMPAT_32BIT is defined, we're building LIB32 and ignore the
value of TARGET_ARCH as we did before.

10 years agoFix dmesg(1) -> dmesg(8)
bapt [Mon, 13 Jan 2014 17:14:10 +0000 (17:14 +0000)]
Fix dmesg(1) -> dmesg(8)

Reported by: trasz

10 years agoFix typo
bapt [Mon, 13 Jan 2014 16:47:25 +0000 (16:47 +0000)]
Fix typo

Reported by: dumbbell

10 years agoUpdate the BUGS section according the recent changes in kldload(8)
bapt [Mon, 13 Jan 2014 16:45:43 +0000 (16:45 +0000)]
Update the BUGS section according the recent changes in kldload(8)

Reviewed by: bdrewery
MFC after: 1 week

10 years agoPoint the user to dmesg(1) to get informations about why loading a module did fail
bapt [Mon, 13 Jan 2014 16:23:09 +0000 (16:23 +0000)]
Point the user to dmesg(1) to get informations about why loading a module did fail
instead of printing the cryptic "Exec format error"

MFC after: 1 week

10 years agoImplement better error recovery for Transaction Translators, TTs,
hselasky [Mon, 13 Jan 2014 15:21:11 +0000 (15:21 +0000)]
Implement better error recovery for Transaction Translators, TTs,
found in High Speed USB HUBs which translate from High Speed USB into
FULL or LOW speed USB. In some rare cases SPLIT transactions might get
lost, which might leave the TT in an unknown state. Whenever we detect
such an error try to issue either a clear TT buffer request, or if
that is not possible reset the whole TT.

MFC after: 1 week

10 years agoSeparate I/O errors from reception of STALL PID.
hselasky [Mon, 13 Jan 2014 15:06:03 +0000 (15:06 +0000)]
Separate I/O errors from reception of STALL PID.

MFC after: 1 week

10 years agoAdd new testcase for USB mass storage.
hselasky [Mon, 13 Jan 2014 13:27:00 +0000 (13:27 +0000)]
Add new testcase for USB mass storage.

10 years agoMark the bin/pax tests as requiring perl.
jmmv [Mon, 13 Jan 2014 12:17:41 +0000 (12:17 +0000)]
Mark the bin/pax tests as requiring perl.

The effect of this is that the test program is marked as skipped when perl
is missing, instead of marking it as broken due to an execution failure.

MFC after: 3 days

10 years agoPrevent misc_helpers from running as a test.
jmmv [Mon, 13 Jan 2014 10:47:26 +0000 (10:47 +0000)]
Prevent misc_helpers from running as a test.

Do this by generating misc_helpers explicitly, without using the
ATF_TESTS_SH functionality.

While this script is technically an atf-sh test program, it is not intended
to be run as a test and therefore it mustn't end up in the Kyuafile.  Using
ATF_TESTS_SH means that misc_helpers ended up registered in the Kyuafile
and then failed to run as a test.

The alternative would be to supply an explicit Kyuafile from this directory
that lists the known test files, but doing it the way described above will
be easier to maintain.

MFC after: 3 days

10 years agoAdd unmapped IO support to virtio_scsi(4)
bryanv [Mon, 13 Jan 2014 04:46:48 +0000 (04:46 +0000)]
Add unmapped IO support to virtio_scsi(4)

10 years agoAdd unmapped IO support to virtio_blk(4)
bryanv [Mon, 13 Jan 2014 04:43:01 +0000 (04:43 +0000)]
Add unmapped IO support to virtio_blk(4)

10 years agoAdd sglist_append_bio(9) to append a struct bio's data to a sglist
bryanv [Mon, 13 Jan 2014 04:41:08 +0000 (04:41 +0000)]
Add sglist_append_bio(9) to append a struct bio's data to a sglist

Reviewed by: jhb, kib (long ago)

10 years agoAdd atf pkg-config files from the vendor branch.
jmmv [Sun, 12 Jan 2014 22:17:10 +0000 (22:17 +0000)]
Add atf pkg-config files from the vendor branch.

These were originally deleted by mistake (because they were not yet being
installed) and are actually necessary.

This should have been part of r260576 but I missed committing this
directory.

MFC after: 5 days

10 years agoGenerate and install pkg-config files for atf.
jmmv [Sun, 12 Jan 2014 21:56:26 +0000 (21:56 +0000)]
Generate and install pkg-config files for atf.

These files are required to get packages in ports to build against atf and
also to get a couple of currently-failing tests to pass.

I'm following the approach already used by the libusb pkg-config files
installed by the system regarding the location and the install rules.

MFC after: 5 days

10 years agofts(3): Remove stray mentions of the obsolete fts_bignum.
jilles [Sun, 12 Jan 2014 20:47:08 +0000 (20:47 +0000)]
fts(3): Remove stray mentions of the obsolete fts_bignum.

10 years agofts: Stat things relative to the directory fd, if possible.
jilles [Sun, 12 Jan 2014 20:30:55 +0000 (20:30 +0000)]
fts: Stat things relative to the directory fd, if possible.

As a result, the kernel needs to process shorter pathnames if fts is not
changing directories (if fts follows symlinks (-L option to utilities), fts
cannot open "." or FTS_NOCHDIR was specified).

Side effect: If pathnames exceed PATH_MAX, [ENAMETOOLONG] is not hit at the
stat stage but later (opendir or application fts_accpath) or not at all.

10 years agoCorrectly update the count of stuck pages, "addl_page_shortage", in
alc [Sun, 12 Jan 2014 19:04:20 +0000 (19:04 +0000)]
Correctly update the count of stuck pages, "addl_page_shortage", in
vm_pageout_scan().  There were missing increments in two less common cases.

Don't conflate the count of stuck pages and the pageout deficit provided by
vm_page_alloc{,_contig}().  (A proposed fix to the OOM code depends on this.)

Handle held pages consistently in the inactive queue scan.  In the more
common case, we did not move the page to the tail of the queue.  Whereas, in
the less common case, we did.  There's no particular reason to move the page
in the less common case, so remove it.

Perform the calculation of the page shortage for the active queue scan a
little earlier, before the active queue lock is acquired.  The correctness
of this calculation doesn't depend on the active queue lock being held.

Eliminate a redundant variable, "pcount".  Use the more descriptive
variable, "maxscan", in its place.

Apply a few nearby style fixes, e.g., eliminate stray whitespace and excess
parentheses.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division

10 years agoRemove incorrect bit shift when assigning the LUN request field
bryanv [Sun, 12 Jan 2014 17:40:47 +0000 (17:40 +0000)]
Remove incorrect bit shift when assigning the LUN request field

This caused duplicate targets appearing on Google Compute Engine
instances.

PR: kern/185626
Submitted by: Venkatesh Srinivas <venkateshs@google.com>
MFC after: 3 days

10 years agoFix gcc with EABI on big-endian ARM by setting the endian correctly.
andrew [Sun, 12 Jan 2014 15:35:03 +0000 (15:35 +0000)]
Fix gcc with EABI on big-endian ARM by setting the endian correctly.
Without this gcc would generate byte loads for a little-endian core.

MFC after: 1 week

10 years agoMake sure reserved fields of the EHCI DMA descriptors are not dirty
hselasky [Sun, 12 Jan 2014 13:16:25 +0000 (13:16 +0000)]
Make sure reserved fields of the EHCI DMA descriptors are not dirty
after previous transfers.

MFC after: 1 week

10 years agoDon't do synchronous USB requests inside USB transfer callbacks. It is
hselasky [Sun, 12 Jan 2014 11:44:28 +0000 (11:44 +0000)]
Don't do synchronous USB requests inside USB transfer callbacks. It is
technically OK, but not recommended.

MFC after: 1 weeks

10 years agoRemove spaces from boot messages when we print the CPU ID/Family/Stepping
gavin [Sat, 11 Jan 2014 22:41:10 +0000 (22:41 +0000)]
Remove spaces from boot messages when we print the CPU ID/Family/Stepping
to match the rest of the CPU identification lines, and once again fit
into 80 columns in the usual case.

10 years agoAdd some missing .Nm for newer syscalls in existing man pages.
jilles [Sat, 11 Jan 2014 22:00:16 +0000 (22:00 +0000)]
Add some missing .Nm for newer syscalls in existing man pages.

MFC after: 1 week

10 years agofind: Allow -type d without statting everything.
jilles [Sat, 11 Jan 2014 21:12:27 +0000 (21:12 +0000)]
find: Allow -type d without statting everything.

fts(3) detects directories even in FTS_NOSTAT mode (so it can descend into
them).

No functional change is intended, but find commands that use -type d but no
primaries that still require stat/lstat calls make considerably fewer system
calls.

10 years agouse a real uint64_t instead of writing code to emulate one..
jmg [Sat, 11 Jan 2014 20:49:22 +0000 (20:49 +0000)]
use a real uint64_t instead of writing code to emulate one..

I verified w/ a:
dd if=/dev/zero bs=1m count=5000 | sha256
a33351fafd00e4c4bcdee2a1c5d019026500f8cdfeaf91a9b8dbbb2619429659

Reviewed by: cperciva
MFC after: 1 week

10 years agoAdd missing C++11 typeinfos to the libcxxrt version script.
theraven [Sat, 11 Jan 2014 19:02:17 +0000 (19:02 +0000)]
Add missing C++11 typeinfos to the libcxxrt version script.

PR: 185663
MFC after: 1 week

10 years agoAdd firmware for Intel Centrino Wireless-N 105 devices.
gavin [Sat, 11 Jan 2014 18:56:48 +0000 (18:56 +0000)]
Add firmware for Intel Centrino Wireless-N 105 devices.

Committed from: Centrino 105 device

10 years agoRevert r260548. We really should not use IPFW_WLOCK() here
melifaro [Sat, 11 Jan 2014 18:27:34 +0000 (18:27 +0000)]
Revert r260548. We really should not use IPFW_WLOCK() here
but this requires some more playing with IPFW_UH_WLOCK(). Leave till later.

10 years agoFix amd64 build breakage caused by r260532.
neel [Sat, 11 Jan 2014 17:37:53 +0000 (17:37 +0000)]
Fix amd64 build breakage caused by r260532.

Submitted by: Marcus Karlsson (mk@acc.umu.se)
Pointy hat to: me

10 years agoMove xpt_run_devq() call before request completion callback where it was
mav [Sat, 11 Jan 2014 16:52:09 +0000 (16:52 +0000)]
Move xpt_run_devq() call before request completion callback where it was
originally.

I am not sure why exactly have I moved it during one of many refactorings
during camlock project, but obviously it opens race window that may cause
use after free panics during SIM (in reported cases umass(4)) detach.

MFC after: 2 weeks

10 years agoWe don't need chain write lock since we're not modifying its contents.
melifaro [Sat, 11 Jan 2014 16:50:41 +0000 (16:50 +0000)]
We don't need chain write lock since we're not modifying its contents.
LibAliasSetAddress() uses its own mutex to serialize changes.

While here, convert ifp->if_xname access to if_name() function.

MFC after: 2 weeks
Sponsored by: Yandex LLC

10 years agoFix for r260541: do not drop periph reference when request is restarted.
mav [Sat, 11 Jan 2014 16:37:20 +0000 (16:37 +0000)]
Fix for r260541: do not drop periph reference when request is restarted.
CAM_DEV_QFREEZE flag is still there and it will freeze device again.

10 years agoext2fs: fix inode flag conversion.
pfg [Sat, 11 Jan 2014 15:19:04 +0000 (15:19 +0000)]
ext2fs: fix inode flag conversion.

After r252890 we are naively attempting to pass through the
inode flags.  This is technically incorrect as the ext2
inode flags don't match the UFS/system values used in
FreeBSD and a clean conversion is needed.

Some filtering was left in place so the change didn't cause
significant changes in FreeBSD but some of the garbage passed
is likely to be the cause for warning messages in linux.

Fix the issue by resetting the flags before conversion as was
done previously. This also means we will not pass the EXT4_*
inode flags into FreeBSD's inode.

PR: kern/185448
MFC after: 3 days

10 years agoClose the newly-created FD if the pathname is too long.
adrian [Sat, 11 Jan 2014 15:01:30 +0000 (15:01 +0000)]
Close the newly-created FD if the pathname is too long.

Coverity: CID 1007204
Sponsored by: Netflix, Inc.

10 years agoAdd myself as a ports committer
riggs [Sat, 11 Jan 2014 14:56:04 +0000 (14:56 +0000)]
Add myself as a ports committer

Approved by: thierry (mentor)

10 years agoFix a logic error when checking if Tx power entries are greater than 31.
kevlo [Sat, 11 Jan 2014 14:48:16 +0000 (14:48 +0000)]
Fix a logic error when checking if Tx power entries are greater than 31.

10 years agoTake additional reference on SCSI probe periph to cover its freeze count.
mav [Sat, 11 Jan 2014 13:35:36 +0000 (13:35 +0000)]
Take additional reference on SCSI probe periph to cover its freeze count.

Otherwise periph may be invalidated and freed before single-stepping freeze
is dropped, causing use after free panic.

10 years agoBump dates in nestat(1) and route(8) man pages.
melifaro [Sat, 11 Jan 2014 09:44:00 +0000 (09:44 +0000)]
Bump dates in nestat(1) and route(8) man pages.
Fix several small errors introduced by r260524.

Suggested by: glebius
MFC after: 2 weeks

10 years agoOptimise interrupt logic. Technically writing a zero to the XHCI USB
hselasky [Sat, 11 Jan 2014 08:16:31 +0000 (08:16 +0000)]
Optimise interrupt logic. Technically writing a zero to the XHCI USB
status register has no effect. Can happen when the interrupt vector is
shared.

MFC after: 1 week

10 years agoForce clearing of event ring interrupts. The "Intel Lynx Point" XHCI
hselasky [Sat, 11 Jan 2014 08:10:01 +0000 (08:10 +0000)]
Force clearing of event ring interrupts. The "Intel Lynx Point" XHCI
controller found in the MBP2013 has been observed to not work properly
unless this operation is performed.

MFC after: 1 week
Tested by: Huang Wen Hui <huanghwh@gmail.com>

10 years agoMove USB ID from u3g driver to uhso driver.
hselasky [Sat, 11 Jan 2014 07:53:03 +0000 (07:53 +0000)]
Move USB ID from u3g driver to uhso driver.

Submitted by: Lundberg, Johannes <johannes@brilliantservice.co.jp>
MFC after: 1 week

10 years agoSave and restore the GPIOs on the macio for suspend/resume.
jhibbits [Sat, 11 Jan 2014 06:35:29 +0000 (06:35 +0000)]
Save and restore the GPIOs on the macio for suspend/resume.

10 years agoEnable "Posted Interrupt Processing" if supported by the CPU. This lets us
neel [Sat, 11 Jan 2014 04:22:00 +0000 (04:22 +0000)]
Enable "Posted Interrupt Processing" if supported by the CPU. This lets us
inject interrupts into the guest without causing a VM-exit.

This feature can be disabled by setting the tunable "hw.vmm.vmx.use_apic_pir"
to "0".

The following sysctls provide information about this feature:
- hw.vmm.vmx.posted_interrupts (0 if disabled, 1 if enabled)
- hw.vmm.vmx.posted_interrupt_vector (vector number used for vcpu notification)

Tested on a Intel Xeon E5-2620v2 courtesy of Allan Jude at ScaleEngine.

10 years agoEnable the "Acknowledge Interrupt on VM exit" VM-exit control.
neel [Sat, 11 Jan 2014 03:14:05 +0000 (03:14 +0000)]
Enable the "Acknowledge Interrupt on VM exit" VM-exit control.

This control is needed to enable "Posted Interrupts" and is present in all
the Intel VT-x implementations supported by bhyve so enable it as the default.

With this VM-exit control enabled the processor will acknowledge the APIC and
store the vector number in the "VM-Exit Interruption Information" field. We
now call the interrupt handler "by hand" through the IDT entry associated
with the vector.

10 years agouse explicit casts with void* to compile when included by C++ code
luigi [Sat, 11 Jan 2014 00:00:11 +0000 (00:00 +0000)]
use explicit casts with void* to compile when included by C++ code

10 years agoFix path to the process_helpers for the libatf-c++ tests.
jmmv [Fri, 10 Jan 2014 23:41:01 +0000 (23:41 +0000)]
Fix path to the process_helpers for the libatf-c++ tests.

Because we respect the FreeBSD src tree layout under /usr/tests, and because
the layout of the tests in the atf distfile does not match the former, the
tests for atf-c++ were not able to find the process_helper binary.

Fix this by explicitly hardcoding the right path in the FreeBSD test suite.

Obtained from: atf (git 1f0e878f7f127741a3762883ef24aef317e239d5)
MFC after: 1 week

10 years agoRespect the original layout of the atf-{c,c++} tests.
jmmv [Fri, 10 Jan 2014 23:38:33 +0000 (23:38 +0000)]
Respect the original layout of the atf-{c,c++} tests.

Put test programs for internal modules into a 'detail' subdirectory of the
libatf-c and libatf-c++ test directories, just as the upstream distribution
does.  This is necessary because the tests assume such layout to find the
process_helper program, and currently fail because of this divergence.

MFC after: 1 week

10 years agoAdd -4/-6 shorthand for -finet/-finet6 in route(8) and netstat(8).
melifaro [Fri, 10 Jan 2014 23:08:18 +0000 (23:08 +0000)]
Add -4/-6 shorthand for -finet/-finet6 in route(8) and netstat(8).

MFC after: 2 weeks

10 years agoBuild the geom_uncompress(4) module by default.
loos [Fri, 10 Jan 2014 20:29:46 +0000 (20:29 +0000)]
Build the geom_uncompress(4) module by default.

Fix geom_uncompress(4) module loading.  Don't link zlib.c (which is a module
itself) directly.

The built module was verified and used to read a few mkulzma(8) images on
amd64 to validate some of the informations on the manual page.

While here, don't overwrite CFLAGS.

Reviewed by: ray
Approved by: adrian (mentor)

10 years agoAdd the manual page for geom_uncompress(4).
loos [Fri, 10 Jan 2014 19:41:01 +0000 (19:41 +0000)]
Add the manual page for geom_uncompress(4).

Approved by: adrian (mentor)

10 years agoRemove not applicable PI_SDTR_ABLE and PI_WIDE_16 hba_inquiry flags to
mav [Fri, 10 Jan 2014 19:21:46 +0000 (19:21 +0000)]
Remove not applicable PI_SDTR_ABLE and PI_WIDE_16 hba_inquiry flags to
make CAM to not try negotiate unsupported settings and suppress warnings.

While there, enable command queuing on pass-through devices, announced
in hba_inquiry, but disabled.  Even though queue size is very small, It
seems working well enough.

Reviewed by: scottl
MFC after: 2 weeks

10 years agoFix netmap emulation when NICs attached to a VALE switch have a different
luigi [Fri, 10 Jan 2014 16:01:44 +0000 (16:01 +0000)]
Fix netmap emulation when NICs attached to a VALE switch have a different
number of tx and rx rings

Submitted by: Vincenzo Maffione

10 years agosync with our internal repo - small change in debugging messages
luigi [Fri, 10 Jan 2014 16:00:27 +0000 (16:00 +0000)]
sync with our internal repo - small change in debugging messages

10 years agoUse m_get2() instead of m_getcl().
kevlo [Fri, 10 Jan 2014 14:47:20 +0000 (14:47 +0000)]
Use m_get2() instead of m_getcl().

Spotted by: glebius

10 years agoMechanically replace direct accessing to if_xname to using if_name() macro.
ae [Fri, 10 Jan 2014 12:33:28 +0000 (12:33 +0000)]
Mechanically replace direct accessing to if_xname to using if_name() macro.

10 years agoReplace several instances of -1 with appropriate CAM_*_WILDCARD and types.
mav [Fri, 10 Jan 2014 12:18:05 +0000 (12:18 +0000)]
Replace several instances of -1 with appropriate CAM_*_WILDCARD and types.

It was equal before r259397, but for good or bad, not any more for LUNs.

This change fixes at least CAM debugging.

10 years agoSimplify inet alias handling code: if we're adding/removing alias which
melifaro [Fri, 10 Jan 2014 12:13:55 +0000 (12:13 +0000)]
Simplify inet alias handling code: if we're adding/removing alias which
has the same prefix as some other alias on the same interface, use
newly-added rt_addrmsg() instead of hand-rolled in_addralias_rtmsg().

This eliminates the following rtsock messages:

Pinned RTM_ADD for prefix (for alias addition).
Pinned RTM_DELETE for prefix (for alias withdrawal).

Example (got 10.0.0.1/24 on vlan4, playing with 10.0.0.2/24):

before commit, addition:

  got message of size 116 on Fri Jan 10 14:13:15 2014
  RTM_NEWADDR: address being added to iface: len 116, metric 0, flags:
  sockaddrs: <NETMASK,IFP,IFA,BRD>
   255.255.255.0 vlan4:8.0.27.c5.29.d4 10.0.0.2 10.0.0.255

  got message of size 192 on Fri Jan 10 14:13:15 2014
  RTM_ADD: Add Route: len 192, pid: 0, seq 0, errno 0, flags:<UP,PINNED>
  locks:  inits:
  sockaddrs: <DST,GATEWAY,NETMASK>
   10.0.0.0 10.0.0.2 (255) ffff ffff ff

after commit, addition:

  got message of size 116 on Fri Jan 10 13:56:26 2014
  RTM_NEWADDR: address being added to iface: len 116, metric 0, flags:
  sockaddrs: <NETMASK,IFP,IFA,BRD>
   255.255.255.0 vlan4:8.0.27.c5.29.d4 14.0.0.2 14.0.0.255

before commit, wihdrawal:

  got message of size 192 on Fri Jan 10 13:58:59 2014
  RTM_DELETE: Delete Route: len 192, pid: 0, seq 0, errno 0, flags:<UP,PINNED>
  locks:  inits:
  sockaddrs: <DST,GATEWAY,NETMASK>
   10.0.0.0 10.0.0.2 (255) ffff ffff ff

  got message of size 116 on Fri Jan 10 13:58:59 2014
  RTM_DELADDR: address being removed from iface: len 116, metric 0, flags:
  sockaddrs: <NETMASK,IFP,IFA,BRD>
   255.255.255.0 vlan4:8.0.27.c5.29.d4 10.0.0.2 10.0.0.255

adter commit, withdrawal:

  got message of size 116 on Fri Jan 10 14:14:11 2014
  RTM_DELADDR: address being removed from iface: len 116, metric 0, flags:
  sockaddrs: <NETMASK,IFP,IFA,BRD>
   255.255.255.0 vlan4:8.0.27.c5.29.d4 10.0.0.2 10.0.0.255

Sending both RTM_ADD/RTM_DELETE messages to rtsock is completely wrong
(and requires some hacks to keep prefix in route table on RTM_DELETE).

I've tested this change with quagga (no change) and bird (*).

bird alias handling is already broken in *BSD sysdep code, so nothing
changes here, too.

I'm going to MFC this change if there will be no complains about behavior
change.

While here, fix some style(9) bugs introduced by r260488
(pointed by glebius and bde).

Sponsored by: Yandex LLC
MFC after: 4 weeks

10 years agoRun the sh(1) and test(1) tests as unprivileged.
jmmv [Fri, 10 Jan 2014 10:39:01 +0000 (10:39 +0000)]
Run the sh(1) and test(1) tests as unprivileged.

One of the tests for test(1) fails and some of the tests for sh(1) are
silently bypassed when running as root.

To fix these tests and ensure they all run, mark the test programs for
sh(1) and test(1) as requiring an unprivileged user.  (This should and
will be the default in Kyua but isn't yet.)

MFC after: 1 week

10 years agoAllow tests to provide a Kyuafile when they relied on auto-generation.
jmmv [Fri, 10 Jan 2014 10:36:14 +0000 (10:36 +0000)]
Allow tests to provide a Kyuafile when they relied on auto-generation.

When generating a Kyuafile in the KYUAFILE=auto case, use a filename
that is unlikely to clash with the filename used by explicitly-provided
Kyuafiles.

This allows a Makefile to set KYUAFILE=yes and provide a Kyuafile in
the same directory when such Makefile was previously relying on
KYUAFILE=auto.

Fixes issues with new Kyuafiles not being picked up in NO_CLEAN builds
(although manual intervention is required once, unfortunately, as
described in UPDATING).

Reviewed by: sjg
MFC after: 1 week

10 years agoUse m_getcl() instead of MGETHDR/MCLGET macros.
kevlo [Fri, 10 Jan 2014 02:47:20 +0000 (02:47 +0000)]
Use m_getcl() instead of MGETHDR/MCLGET macros.

Suggested by: glebius

10 years agorevert part of r260485 which changes how part of the header gets
jmg [Thu, 9 Jan 2014 22:41:18 +0000 (22:41 +0000)]
revert part of r260485 which changes how part of the header gets
included..  netstat uses -DKERNEL=1 to get these parts and breaks the
build w/o it...

melifaro@ says that ae@ is probably asleep, and the PR doesn't have
this part of the patch...  Probably a local change got in by accident..

PR: 185148
Pointy hat to: ae@

10 years agoFix a braino with r259730: we cannot currently use CFLAGS.gcc or
dim [Thu, 9 Jan 2014 22:16:30 +0000 (22:16 +0000)]
Fix a braino with r259730: we cannot currently use CFLAGS.gcc or
CFLAGS.clang in sys/conf/Makefile.arm, since the main kernel build does
not use <bsd.sys.mk>.  So revert that particular change for now.

Pointy hat to: me
Noticed by: zbb
MFC after: 3 days
X-MFC-With: r259730

10 years agoAdd a prototype for the new arm_devmap_print_table(). This should have
ian [Thu, 9 Jan 2014 20:57:19 +0000 (20:57 +0000)]
Add a prototype for the new arm_devmap_print_table().  This should have
been part of r260490.

10 years agoCheck if the given argument to 'gpart add' is actually a geom device and
lme [Thu, 9 Jan 2014 20:06:14 +0000 (20:06 +0000)]
Check if the given argument to 'gpart add' is actually a geom device and
give a hint to use 'gpart create' before trying to add a partition.

Approved by: pjd

10 years agoUse .cpp as the extension for temporary C++ files.
jmmv [Thu, 9 Jan 2014 18:53:21 +0000 (18:53 +0000)]
Use .cpp as the extension for temporary C++ files.

Using a .c extension for a C++ file raises the following warning, which
breaks our header file tests if the compiler is using -Werror as well:

c++: warning: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated

Obtained from: atf (git 3104010c2849330440cc0ce108ff341913433339)
MFC after: 3 days

10 years agoAdd a function to print the contents of the static device mapping table,
ian [Thu, 9 Jan 2014 18:51:57 +0000 (18:51 +0000)]
Add a function to print the contents of the static device mapping table,
and invoke it for bootverbose logging, and also from a new DDB command,
"show devmap".  Also tweak the format string for the bootverbose output
of physical memory chunks to get the leading zeros in the hex values.

10 years agoSplit rt_newaddrmsg_fib() into two different functions.
melifaro [Thu, 9 Jan 2014 18:13:25 +0000 (18:13 +0000)]
Split rt_newaddrmsg_fib() into two different functions.
Adding/deleting interface addresses involves access to 3 different subsystems,
int different parts of code. Each call can fail, so reporting successful
operation by rtsock in the middle of the process error-prone.

Further split routing notification API and actual rtsock calls via creating
public-available rt_addrmsg() / rt_routemsg() functions with "private"
rtsock_* backend.

MFC after: 2 weeks

10 years agoRemove very low default limit of 4 nfsd threads. nfsd's own default is
mav [Thu, 9 Jan 2014 15:55:55 +0000 (15:55 +0000)]
Remove very low default limit of 4 nfsd threads.  nfsd's own default is
8 * hw.ncpu, that sounds more appropriate for these SMP/NCQ/... days.

10 years agoRemove extra nesting from X_ip6_mforward() function.
ae [Thu, 9 Jan 2014 15:38:28 +0000 (15:38 +0000)]
Remove extra nesting from X_ip6_mforward() function.
Also remove disabled definitions from ip6_mroute.h.

PR: 185148
Sponsored by: Yandex LLC

10 years agoFix error counting
bapt [Thu, 9 Jan 2014 15:35:35 +0000 (15:35 +0000)]
Fix error counting

10 years agoImport error message shown to the user when trying to load a module that is
bapt [Thu, 9 Jan 2014 15:34:23 +0000 (15:34 +0000)]
Import error message shown to the user when trying to load a module that is
already loaded or compiled withing the kernel

MFC after: 1 week

10 years agoBe much more specific (and correct) about the device id matching.
adrian [Thu, 9 Jan 2014 15:31:44 +0000 (15:31 +0000)]
Be much more specific (and correct) about the device id matching.

These device IDs have an AR3012 bluetooth device that shows up with
bcdDevice=1 when it doesn't have the firmware loaded, and bcdDevice=2
when it's ready to speak full HCI.

Tested:

* AR5B225 PCIe - AR9485 + AR3012

10 years agoAdd MRT6_DLOG() macro for debugging.
ae [Thu, 9 Jan 2014 14:58:06 +0000 (14:58 +0000)]
Add MRT6_DLOG() macro for debugging.
Reduce number of MRT6DEBUG ifdefs and fix some broken format strings.

MFC after: 1 week
Sponsored by: Yandex LLC

10 years agoDo some more sanity checks in route(8): require netmask to have
melifaro [Thu, 9 Jan 2014 10:40:36 +0000 (10:40 +0000)]
Do some more sanity checks in route(8): require netmask to have
the same address family as destination.

Found by: jmg
MFC after: 2 weeks

10 years agoAlways create /var/run/casper with correct permissions and don't depend on the
pjd [Thu, 9 Jan 2014 09:19:59 +0000 (09:19 +0000)]
Always create /var/run/casper with correct permissions and don't depend on the
calling process' umask.

Submitted by: Mikhail <mp@lenta.ru>

10 years agoFix issue with the virtio descriptor region being truncated
grehan [Thu, 9 Jan 2014 07:17:21 +0000 (07:17 +0000)]
Fix issue with the virtio descriptor region being truncated
if it was above 4GB. This was seen with CentOS 6.5 guests with
large RAM, since the block drivers are loaded late in the
boot sequence and end up allocating descriptor memory from
high addresses.

Reported by: Michael Dexter
MFC after: 3 days

10 years agoDon't expose 'vmm_ipinum' as a global.
neel [Thu, 9 Jan 2014 03:25:54 +0000 (03:25 +0000)]
Don't expose 'vmm_ipinum' as a global.

10 years agoReplace deprecated M_DONTWAIT with M_NOWAIT.
kevlo [Thu, 9 Jan 2014 01:48:33 +0000 (01:48 +0000)]
Replace deprecated M_DONTWAIT with M_NOWAIT.

10 years agoFix build with VIMAGE.
glebius [Thu, 9 Jan 2014 00:59:03 +0000 (00:59 +0000)]
Fix build with VIMAGE.

10 years agoRefactor out the common sendfile code from the do_sendfile() and the
adrian [Thu, 9 Jan 2014 00:11:14 +0000 (00:11 +0000)]
Refactor out the common sendfile code from the do_sendfile() and the
compat32 sendfile syscall.

Sponsored by: Netflix, Inc.

10 years agoConstanly use RT_ALL_FIBS everywhere instead of -1.
melifaro [Wed, 8 Jan 2014 23:09:02 +0000 (23:09 +0000)]
Constanly use RT_ALL_FIBS everywhere instead of -1.

MFC after: 2 weeks

10 years agoDon't expose svc_loss_reg / _unreg to userland as they're kernel-only
peter [Wed, 8 Jan 2014 22:37:18 +0000 (22:37 +0000)]
Don't expose svc_loss_reg / _unreg to userland as they're kernel-only
additions from r260229 and the SVCPOOL type doesn't exist in userland.