]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoRevert r251023 until a more proper solution is found
hselasky [Tue, 28 May 2013 18:51:30 +0000 (18:51 +0000)]
Revert r251023 until a more proper solution is found
for ATI based USB controllers.

MFC after: 1 week

11 years agoAdded missing SCSI quirks from r241784
smh [Tue, 28 May 2013 14:44:37 +0000 (14:44 +0000)]
Added missing SCSI quirks from r241784

Re-ordered SSD quirks alphabetically so they are easier to maintain.

Removed my email and PR reference from comments on each quirk.

Added quirks for more SSDs:
* Crucial M4
* Corsair Force GT
* Intel 520 Series
* Kingston E100 Series
* Samsung 830 Series

Reviewed by: pjd (mentor)
Approved by: pjd (mentor)
MFC after: 1 week

11 years ago- Fix wording. [1]
markj [Tue, 28 May 2013 13:54:26 +0000 (13:54 +0000)]
- Fix wording. [1]
- Improve the descriptions in the FILES section. [2]

Reported by: Jason McIntyre [1]
Obtained from: NetBSD [2]
MFC after: 3 days

11 years agoDuring buildkernel, print a banner before building modules.
des [Tue, 28 May 2013 09:52:28 +0000 (09:52 +0000)]
During buildkernel, print a banner before building modules.

11 years agomdoc: silence a few mandoc lint warnings.
joel [Tue, 28 May 2013 09:33:46 +0000 (09:33 +0000)]
mdoc: silence a few mandoc lint warnings.

11 years agoRemove redundant checks.
tuexen [Tue, 28 May 2013 09:25:58 +0000 (09:25 +0000)]
Remove redundant checks.

MFC after: 2 weeks

11 years agoFix cexp regression tests that have an infinite real part. The signs of the
tijl [Tue, 28 May 2013 08:50:50 +0000 (08:50 +0000)]
Fix cexp regression tests that have an infinite real part. The signs of the
result depend on the cosine and sine of the imaginary part.
Small values are used in the new tests such that cosine and sine are well
defined.

Reviewed by: das

11 years agoThe getcontext() from the __fillcontextx() call in the
kib [Tue, 28 May 2013 04:54:16 +0000 (04:54 +0000)]
The getcontext() from the __fillcontextx() call in the
check_deferred_signal() returns twice, since handle_signal() emulates
the return from the normal signal handler by sigreturn(2)ing the
passed context.  Second return is performed on the destroyed stack
frame, because __fillcontextx() has already returned.  This causes
undefined and bad behaviour, usually the victim thread gets SIGSEGV.

Avoid nested frame and the need to return from it by doing direct call
to getcontext() in the check_deferred_signal() and using a new private
libc helper __fillcontextx2() to complement the context with the
extended CPU state if the deferred signal is still present.

The __fillcontextx() is now unused, but is kept to allow older
libthr.so to be used with the new libc.

Mark __fillcontextx() as returning twice [1].

Reported by: pgj
Pointy hat to: kib
Discussed with: dim
Tested by: pgj, dim
Suggested by: jilles [1]
MFC after: 1 week

11 years agoStyle(9)
kargl [Mon, 27 May 2013 22:45:05 +0000 (22:45 +0000)]
Style(9)

Approved by: das (implicit)
Reported by: jh

11 years agoChange the closeallfds() routine to use closefrom() when it is
gad [Mon, 27 May 2013 22:19:01 +0000 (22:19 +0000)]
Change the closeallfds() routine to use closefrom() when it is
available (closefrom() was added to FreeBSD in 8.0-release).
The selection is made at compile-time, as I still compile a
FreeBSD-based version of lpr&friends on other platforms.

While testing I out that (at least on my system) lpd has been
closing 11095 fd's, when there are only 6 fd's open.  The old
code took 120 times more clocktime than calling closefrom().
(although that was still less than 2/1000-ths of a second!)

Reviewed by: jilles
MFC after: 2 weeks

11 years agocap_rights_limit(2): CAP_ACCEPT also permits accept4(2).
jilles [Mon, 27 May 2013 21:37:19 +0000 (21:37 +0000)]
cap_rights_limit(2): CAP_ACCEPT also permits accept4(2).

11 years ago* Update polynomial coefficients.
kargl [Mon, 27 May 2013 20:43:16 +0000 (20:43 +0000)]
* Update polynomial coefficients.
* Use ENTERI/RETURNI to allow the use of FP_PE on i386 target.

Reviewed by: das (and bde a long time ago)
Approved by: das (mentor)
Obtained from: bde (polynomial coefficients)

11 years agoPartially apply the capitalization of the heading word of the sequence
kib [Mon, 27 May 2013 18:45:45 +0000 (18:45 +0000)]
Partially apply the capitalization of the heading word of the sequence
and fix typo.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoUse slightly more idiomatic expression to get the address of array.
kib [Mon, 27 May 2013 18:39:39 +0000 (18:39 +0000)]
Use slightly more idiomatic expression to get the address of array.

Tested by: dim, pgj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoThe _MC_HASFPXSTATE and _MC_IA32_HASFPXSTATE flags have the same bit
kib [Mon, 27 May 2013 18:36:46 +0000 (18:36 +0000)]
The _MC_HASFPXSTATE and _MC_IA32_HASFPXSTATE flags have the same bit
value on purpose, but the ia32 context handling code is logically more
correct to use the _MC_IA32_HASFPXSTATE name for the flag.

Tested by: dim, pgj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoThe ia32_get_mcontext() does not need to set PCB_FULL_IRET. The
kib [Mon, 27 May 2013 18:31:15 +0000 (18:31 +0000)]
The ia32_get_mcontext() does not need to set PCB_FULL_IRET.  The
usermode context state is not changed by the get operation, and
get_mcontext() does not require full iret as well.

Tested by: dim, pgj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoWhen reporting the fault details, also print %rsp.
kib [Mon, 27 May 2013 18:29:20 +0000 (18:29 +0000)]
When reporting the fault details, also print %rsp.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoWhen handling an exception from the attempt from loading the faulting
kib [Mon, 27 May 2013 18:26:08 +0000 (18:26 +0000)]
When handling an exception from the attempt from loading the faulting
context on return from the trap handler, re-enable the interrupts on
i386 and amd64.  The trap return path have to disable interrupts since
the sequence of loading the machine state is not atomic.  The trap()
function which transfers the control to the special handler would
enable the interrupt, but an iret loads the previous eflags with PSL_I
clear.  Then, the special handler calls trap() on its own, which now
sees the original eflags with PSL_I set and does not enable
interrupts.

The end result is that signal delivery and process exiting code could
be executed with interrupts disabled, which is generally wrong and
triggers several assertions.

For amd64, the interrupts are enabled conditionally based on PSL_I in
the eflags of the outer frame, as it is already done for
doreti_iret_fault.  For i386, the interrupts are enabled
unconditionally, the ast loop could have opened a window with
interrupts enabled just before the iret anyway.

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

11 years agoFix some regressions caused by the switch from gcc to clang. The fixes
das [Mon, 27 May 2013 08:50:10 +0000 (08:50 +0000)]
Fix some regressions caused by the switch from gcc to clang. The fixes
are workarounds for various symptoms of the problem described in clang
bugs 3929, 8100, 8241, 10409, and 12958.

The regression tests did their job: they failed, someone brought it
up on the mailing lists, and then the issue got ignored for 6 months.
Oops. There may still be some regressions for functions we don't have
test coverage for yet.

11 years agoWorkaround for for a problem seen with ATI Technologies EHCI
hselasky [Mon, 27 May 2013 06:32:07 +0000 (06:32 +0000)]
Workaround for for a problem seen with ATI Technologies EHCI
controller hardware most likely present on UHCI chipsets aswell. The
bug manifests itself when issuing isochronous transfers and bulk
transfers towards the same device simultaneously. From time to time it
happens that either the completion IRQ was missing or that the
completion IRQ was happening before the ITD/SITD was completely
written back to memory. The workaround assumes that double buffered
isochronous transfers are used, and that a second interrupt is
generated at the beginning of the next isochronous transfer to
complete the previous one. Possibly skipping the interrupt at the last
isochronous frame is possible, but will then break single buffered
isochronous transfers. For now we can live with some extra interrupts.

MFC after: 1 week

11 years agoFix ONFI chip detection.
gber [Mon, 27 May 2013 06:24:31 +0000 (06:24 +0000)]
Fix ONFI chip detection.

Submitted by: Alexander Fedorov <alexander.fedorov@rtlservice.com>

11 years agoAdd DTS for AM335x EVM with properly muxed PWM and LCD pins, and
gonzo [Mon, 27 May 2013 00:26:29 +0000 (00:26 +0000)]
Add DTS for AM335x EVM with properly muxed PWM and LCD pins, and
LCD panel description

11 years agoAdd PWM and LCDC nodes to base DTS for AM335x-based devices
gonzo [Mon, 27 May 2013 00:23:59 +0000 (00:23 +0000)]
Add PWM and LCDC nodes to base DTS for AM335x-based devices

11 years agoAM335x LCD controller driver with syscons support
gonzo [Mon, 27 May 2013 00:23:01 +0000 (00:23 +0000)]
AM335x LCD controller driver with syscons support

Limitations:
- Raster mode only
- 24 and 32 bpp only

11 years agoAdd PWM module driver for AM335x. Only eCAS subsystem is supported
gonzo [Mon, 27 May 2013 00:13:27 +0000 (00:13 +0000)]
Add PWM module driver for AM335x. Only eCAS subsystem is supported

Export function to configure eCAS submodule from another drivers.
It's used to control LCD panel backlight on AM335x EVM.

11 years agoAdd SCM registers definitions for AM335x platform
gonzo [Mon, 27 May 2013 00:09:04 +0000 (00:09 +0000)]
Add SCM registers definitions for AM335x platform

11 years agoAdd clock definitions for LCD controller and PWM module
gonzo [Mon, 27 May 2013 00:06:24 +0000 (00:06 +0000)]
Add clock definitions for LCD controller and PWM module

11 years agoMigrate ath(4) to now use if_transmit instead of the legacy if_start
adrian [Sun, 26 May 2013 22:23:39 +0000 (22:23 +0000)]
Migrate ath(4) to now use if_transmit instead of the legacy if_start
and if queue mechanism; also fix up (non-11n) TX fragment handling.

This may result in a bit of a performance drop for now but I plan on
debugging and resolving this at a later stage.

Whilst here, fix the transmit path so fragment transmission works.

The TX fragmentation handling is a bit more special.  In order to
correctly transmit TX fragments, there's a bunch of corner cases that
need to be handled:

* They must be transmitted back to back, in the same order..
* .. ie, you need to hold the TX lock whilst transmitting this
  set of fragments rather than interleaving it with other MSDUs
  destined to other nodes;
* The length of the next fragment is required when transmitting, in
  order to correctly set the NAV field in the current frame to the
  length of the next frame; which requires ..
* .. that we know the transmit duration of the next frame, which ..
* .. requires us to set the rate of all fragments to the same length,
  or make the decision up-front, etc.

To facilitate this, I've added a new ath_buf field to describe the
length of the next fragment.  This avoids having to keep the mbuf
chain together.  This used to work before my 11n TX path work because
the ath_tx_start() routine would be handed a single mbuf with m_nextpkt
pointing to the next frame, and that would be maintained all the way
up to when the duration calculation was done.  This doesn't hold
true any longer - the actual queuing may occur at any point in the
future (think ath_node TID software queuing) so this information
needs to be maintained.

Right now this does work for non-11n frames but it doesn't at all
enforce the same rate control decision for all frames in the fragment.
I plan on fixing this in a followup commit.

RTS/CTS has the same issue, I'll look at fixing this in a subsequent
commit.

Finaly, 11n fragment support requires the driver to have fully
decided what the rate scenario setup is - including 20/40MHz,
short/long GI, STBC, LDPC, number of streams, etc.  Right now that
decision is (currently) made _after_ the NAV field value is updated.
I'll fix all of this in subsequent commits.

Tested:

* AR5416, STA, transmitting 11abg fragments
* AR5416, STA, 11n fragments work but the NAV field is incorrect for
  the reasons above.

TODO:

* It would be nice to be able to queue mbufs per-node and per-TID so
  we can only queue ath_buf entries when it's time to assemble frames
  to send to the hardware.

  But honestly, we should just do that level of software queue management
  in net80211 rather than ath(4), so I'm going to leave this alone for now.

* More thorough AP, mesh and adhoc testing.

* Ensure that net80211 doesn't hand us fragmented frames when A-MPDU has
  been negotiated, as we can't do software retransmission of fragments.

* .. set CLRDMASK when transmitting fragments, just to ensure.

11 years agoUnbreak ia64 tinderbox: 64-bit support was made conditional upon
marcel [Sun, 26 May 2013 22:11:13 +0000 (22:11 +0000)]
Unbreak ia64 tinderbox: 64-bit support was made conditional upon
__amd64__, and thus limited. Eliminate 2 trivial conditionals by
casting the 64-bit integral, holding an address, via (uintptr_t)
to (void *) and replace the last remaining check for __amd64__
with a check for __LP64__ instead.

11 years agos/recieve/receive
schweikh [Sun, 26 May 2013 18:57:59 +0000 (18:57 +0000)]
s/recieve/receive

11 years agoRemove backwards compat layer which was added in r71419 (in 2001).
eadler [Sun, 26 May 2013 14:54:06 +0000 (14:54 +0000)]
Remove backwards compat layer which was added in r71419 (in 2001).

This change is not intended for MFC.

Reviewed by: peter

11 years agoPull in r182656 from upstream llvm trunk:
dim [Sun, 26 May 2013 14:14:42 +0000 (14:14 +0000)]
Pull in r182656 from upstream llvm trunk:

  LoopVectorize: LoopSimplify can't canonicalize loops with an
  indirectbr in it, don't assert on those cases.

  Fixes PR16139.

This should fix clang assertion failures when optimizing at -O3, similar
to:

  Assertion failed: (TheLoop->getLoopPreheader() && "No preheader!!"),
  function canVectorize, file
  contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp, line 2171.

Reported by: O. Hartmann <ohartman@zedat.fu-berlin.de>
PR: ports/178332, ports/178977
MFC after: 3 days

11 years agoMove libmd.so.5 to the proper place and add missing lib32 entry.
antoine [Sun, 26 May 2013 09:25:14 +0000 (09:25 +0000)]
Move libmd.so.5 to the proper place and add missing lib32 entry.

11 years agoRework the comment I initially wrote when SHLIB_LDSCRIPT was introduced.
jlh [Sat, 25 May 2013 22:17:14 +0000 (22:17 +0000)]
Rework the comment I initially wrote when SHLIB_LDSCRIPT was introduced.
The build system is really intricate and I had a hard time to remind the
whole picture even when reading my own words.  This one will hopefully
be better.

11 years agoMake the malloc(3) family of functions weak and make their non-weak
marcel [Sat, 25 May 2013 18:59:11 +0000 (18:59 +0000)]
Make the malloc(3) family of functions weak and make their non-weak
implementations visible for use by applications. The functions $F that
are now weak symbols are:
allocm, calloc, dallocm, free, malloc, malloc_usable_size,
nallocm, posix_memalign, rallocm, realloc, sallocm

The non-weak implementations of $F are exported as __$F.

Submitted by: stevek@juniper.net
Reviewed by: jasone@, kib@
Approved by: jasone@ (jemalloc)
Obtained from: juniper Networks, Inc

11 years agoAdd C11 macros CMPLX(), CMPLXF() and CMPLXL().
ed [Sat, 25 May 2013 18:55:55 +0000 (18:55 +0000)]
Add C11 macros CMPLX(), CMPLXF() and CMPLXL().

Clang allows us to initialize complex numbers using an array
initializer, casted to a complex type. GCC has a builtin called
__builtin_complex().

11 years agoAdd missing #includes, to keep Clang silent.
ed [Sat, 25 May 2013 18:04:24 +0000 (18:04 +0000)]
Add missing #includes, to keep Clang silent.

11 years agoFix some statical clang analyzer warnings.
hselasky [Sat, 25 May 2013 17:09:58 +0000 (17:09 +0000)]
Fix some statical clang analyzer warnings.

11 years agoFix <uchar.h> in for C++11.
ed [Sat, 25 May 2013 16:58:12 +0000 (16:58 +0000)]
Fix <uchar.h> in for C++11.

It turns out that in C++11, char16_t and char32_t are built-in types;
language keywords. Just fix this by putting traditional _*_T_DECLARED
blocks around the definitions. We'll just predefine these in
<sys/_types.h>.

This also opens up the possibility to define char16_t in other header
files, if ever needed (e.g. if we would gain a <ctype.h> for
char16_t/char32_t).

11 years agoPrevent shadowing.
ed [Sat, 25 May 2013 15:36:15 +0000 (15:36 +0000)]
Prevent shadowing.

The name line_number seems to be used as a function parameter name for
one of the Lex functions. Change the name to linenumber.

11 years agosigreturn(2): Remove ancient compatibility warning about 4.2BSD.
jilles [Sat, 25 May 2013 13:59:40 +0000 (13:59 +0000)]
sigreturn(2): Remove ancient compatibility warning about 4.2BSD.

The HISTORY subsection still says that sigreturn() was added in 4.3BSD.

11 years agoMake some tiny improvements to iconv_open().
ed [Sat, 25 May 2013 12:13:54 +0000 (12:13 +0000)]
Make some tiny improvements to iconv_open().

- Remove an unneeded variable.
- Fix whitespace bugs.
- Fix typoes in comment.
- Improve string handling a bit. Don't handroll strstr() and don't
  terminate a strdup()'ed string. Instead, simply strndup() the part we
  need.

11 years agoOnly call free() on something we allocated.
ed [Sat, 25 May 2013 12:11:20 +0000 (12:11 +0000)]
Only call free() on something we allocated.

If we were already provided a struct _citrus_iconv (e.g. through
iconv_open_into()), we should not call free() in case io_init_context()
fails. Instead, call it on the pointer of the allocated object, which
will be NULL in case of iconv_open_into().

11 years agoRevert r250972 to fix build.
gjb [Sat, 25 May 2013 07:17:16 +0000 (07:17 +0000)]
Revert r250972 to fix build.

11 years agoFix net80211 fragment creation.
adrian [Sat, 25 May 2013 06:28:30 +0000 (06:28 +0000)]
Fix net80211 fragment creation.

When creating fragment frames, the header length should honour the
DATAPAD flag.

This fixes the fragments that are queued to the ath(4) driver but it
doesn't yet fix fragment transmission.  That requires further changes
to the ath(4) transmit path.  Well, strictly speaking, it requires
further changes to _all_ wifi driver transmit paths, but this is at least
a start.

Tested:

* AR5416, STA mode, w/ fragthreshold set to 256.

11 years agoThe error handling for writes to the target file could lead to the final
se [Fri, 24 May 2013 18:54:52 +0000 (18:54 +0000)]
The error handling for writes to the target file could lead to the final
fclose() being skipped. Fix this by using boolean "&" and "|" instead of
short-cut operators "&&" and "||".
While here, increment the last part of the version string. The reason is
the fixed output file selection logic in pch.c, which was committed as
r250943, yesterday.

Reviewed by: pfg

11 years agoFix building on slightly older -current and stable systems after
marcel [Fri, 24 May 2013 15:53:13 +0000 (15:53 +0000)]
Fix building on slightly older -current and stable systems after
the switch to bmake. The rescue bits are built via crunchgen,
which didn't respect the MAKE environment variable until r237574
(i.e. ~11 months ago). This resulted in a failure due to bmake's
internal -J flag being passed around and not being understood by
the standard (i.e. host's) make.
Note that the failure is conditional upon having the jobServer
feature enabled within bmake.

11 years agoMention the "nojailvnet" keyword.
jamie [Fri, 24 May 2013 14:57:38 +0000 (14:57 +0000)]
Mention the "nojailvnet" keyword.

MFC after: 3 days

11 years agoEnforce validation on the selected delete method via sysctl.
smh [Fri, 24 May 2013 11:27:06 +0000 (11:27 +0000)]
Enforce validation on the selected delete method via sysctl.

This prevents users from selecting a delete method which may cause
corruption e.g. MPS WS16 on pre P14 firmware.

Reviewed by: pjd (mentor)
Approved by: pjd (mentor)
MFC after: 2 days

11 years agoFix the data corruption on the swap-backed md.
kib [Fri, 24 May 2013 09:48:42 +0000 (09:48 +0000)]
Fix the data corruption on the swap-backed md.

Assign the rv variable a success code if the pager was not asked for
the page.  Using an error code from the previous processed page caused
zeroing of the valid page, when e.g. the previous page was not
available in the pager.

Reported by: lstewart
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoDriver 'aacraid' added. Supports Adaptec by PMC RAID controller families Series 6...
achim [Fri, 24 May 2013 09:22:43 +0000 (09:22 +0000)]
Driver 'aacraid' added. Supports Adaptec by PMC RAID controller families Series 6, 7, 8 and upcoming products. Older Adaptec RAID controller families are supported by the 'aac' driver.

Approved by: scottl (mentor)

11 years agoWithdraw http://svnweb.freebsd.org/changeset/base/250809
tuexen [Fri, 24 May 2013 09:21:18 +0000 (09:21 +0000)]
Withdraw http://svnweb.freebsd.org/changeset/base/250809
since the real fix is in http://svnweb.freebsd.org/changeset/base/250952.

11 years agoThe fasttrap provider cleans up probes asynchronously when a process with
markj [Fri, 24 May 2013 03:29:32 +0000 (03:29 +0000)]
The fasttrap provider cleans up probes asynchronously when a process with
USDT probes exits. This was previously done with a callout; however, it is
possible to sleep while holding the DTrace mutexes, so a panic will occur
on INVARIANTS kernels if the callout handler can't immediately acquire one
of these mutexes. This panic will be frequently triggered on systems where
a USDT-enabled program (perl, for instance) is often run.

This revision changes the fasttrap cleanup mechanism so that a dedicated
thread is used instead of a callout. The old behaviour is otherwise
preserved.

Reviewed by: rpaulo
MFC after: 1 month

11 years agoInitialising the new fibnum field to a known value turns out to
julian [Fri, 24 May 2013 02:18:37 +0000 (02:18 +0000)]
Initialising the new fibnum field to a known value turns out to
be a GOOD IDEA (TM).
Apparently MOST users set this (e.g. tcp and friends) but there are a few
users that just assume that it is a sensible value but then go on to read it.
These include SCTP, pf and the FLOWTABLE option (and maybe others).

11 years agoEnsure alq's shutdown_pre_sync event handler is deregistered on module unload to
lstewart [Fri, 24 May 2013 00:49:12 +0000 (00:49 +0000)]
Ensure alq's shutdown_pre_sync event handler is deregistered on module unload to
avoid a dangling pointer and eventual panic on system shutdown.

Reported by: Ali <comnetboy at gmail.com>
Tested by: Ali <comnetboy at gmail.com>
MFC after: 1 week

11 years agoWhile waiting for the bpf hold buffer to become idle, check
ghelmer [Thu, 23 May 2013 21:33:10 +0000 (21:33 +0000)]
While waiting for the bpf hold buffer to become idle, check
the return value from mtx_sleep() and exit bpfread() on
errors such as EINTR.

Reviewed by: jhb

11 years agoUse proper malloc type for ioctls white-list.
pjd [Thu, 23 May 2013 21:07:26 +0000 (21:07 +0000)]
Use proper malloc type for ioctls white-list.

Reported by: pho
Tested by: pho

11 years agoFix target selection logic, which did not comply with the man page.
se [Thu, 23 May 2013 20:57:20 +0000 (20:57 +0000)]
Fix target selection logic, which did not comply with the man page.

Instead of using the file with the least order of path name components,
shortest filename and finally the shortest basename (with the search
stopping as soon as one of these conditions is true), the first filename
checked was used as the reference, and another filename was only selected
if all of the above comparisons are in favour of the latter file.

This was wrong, because filenames with path less components were only
considered, if both of the other conditions were true as well. In fact,
the first filename to be checked had good chances to be selected in the
end, since it only needed to be better with regard to any one of the
three criteria ...

Reviewed by: delphij@freebsd.org

11 years agoAdd support for netgroup, based on patch in the PR but made consistent
ghelmer [Thu, 23 May 2013 20:52:30 +0000 (20:52 +0000)]
Add support for netgroup, based on patch in the PR but made consistent
with existing style.

PR: bin/132692

11 years agoInclude descriptions of the flags and fields printed when dumping the
markj [Thu, 23 May 2013 19:50:36 +0000 (19:50 +0000)]
Include descriptions of the flags and fields printed when dumping the
IPv6 prefix list.

Reviewed by: hrs
MFC after: 1 week

11 years agoChange the copyright notice to a standard BSD 2-clause license and assign
marcel [Thu, 23 May 2013 19:47:37 +0000 (19:47 +0000)]
Change the copyright notice to a standard BSD 2-clause license and assign
ownership to the FreeBSD foundation for the years this file has been in
the FreeBSD repository.

This file was originally created by Juniper as part of upgrading to FreeBSD
4.10 (which had no MIPS support) and held functions found on other machines
It grew actual functionality over time. The functionaliy was copied from
other architectures and ported to MIPS on a as-needed basis.

Approved by: Mark Baushke (Juniper IP)
Approved by: Megan Sugiyama (Juniper legal)
Pointed out by: jmallett@
Requested by: core (jhb@)

11 years agoCorrect the description of the -a option: rtsol(d) -a will in fact send out
markj [Thu, 23 May 2013 19:47:35 +0000 (19:47 +0000)]
Correct the description of the -a option: rtsol(d) -a will in fact send out
router solicitations on multiple interfaces.

Reviewed by: hrs
MFC after: 1 week

11 years agoLet iconv build on -HEAD properly.
ed [Thu, 23 May 2013 18:07:01 +0000 (18:07 +0000)]
Let iconv build on -HEAD properly.

- Add NO_WMISSING_VARIABLE_DECLARATIONS where we use Yacc/Lex.
- Add variable declarations where possible.
- Add missing static keyword.

11 years agoFix typo in the definition of the TWS_DATA_CCB.
kib [Thu, 23 May 2013 16:37:43 +0000 (16:37 +0000)]
Fix typo in the definition of the TWS_DATA_CCB.

Submitted by: Andreas Turriff <maillist@turriff.net>

11 years agoRework and organize pmap_enter_locked() function.
gber [Thu, 23 May 2013 12:24:46 +0000 (12:24 +0000)]
Rework and organize pmap_enter_locked() function.

pmap_enter_locked() implementation was very ambiguous and confusing.
Rearrange it so that each part of the mapping creation is separated.
Avoid walking through the redundant conditions.
Extract vector_page specific PTE setup from normal PTE setting.

Submitted by:   Zbigniew Bodek <zbb@semihalf.com>
Sponsored by:   The FreeBSD Foundation, Semihalf

11 years agoStop using PVF_MOD, PVF_REF & PVF_EXEC flags in pv_entry, use PTE.
gber [Thu, 23 May 2013 12:23:18 +0000 (12:23 +0000)]
Stop using PVF_MOD, PVF_REF & PVF_EXEC flags in pv_entry, use PTE.

Using PVF_MOD, PVF_REF and PVF_EXEC is redundant as we can get the proper
info from PTE bits.
When the mapping is marked as executable and has been referenced we assume
that it has been executed. Similarly, when the mapping is set to be writable
and is referenced, it must have been due to write access to it.
PVF_MOD and PVF_REF flags are kept just for pmap_clearbit() usage,
to pass the information on which bit should be cleared.

Submitted by:   Zbigniew Bodek <zbb@semihalf.com>
Sponsored by:   The FreeBSD Foundation, Semihalf

11 years agoImprove, optimize and clean-up ARMv6/v7 memory management related code.
gber [Thu, 23 May 2013 12:15:23 +0000 (12:15 +0000)]
Improve, optimize and clean-up ARMv6/v7 memory management related code.

Use pmap_find_pv if needed instead of multiplying its code throughout
pmap-v6.

Avoid possible NULL pointer dereference in pmap_enter_locked()
When trying to get m->md.pv_memattr, make sure that m != NULL,
in particular that vector_page is set to be NULL.

Do not set PGA_REFERENCED flag in pmap_enter_pv().
On ARM any new page reference will result in either entering the new
mapping by calling pmap_enter, etc. or fixing-up the existing mapping in
pmap_fault_fixup().
Therefore we set PGA_REFERENCED flag in the earlier mentioned cases and
setting it later in pmap_enter_pv() is just waste of cycles.

Delete unused pm_pdir pointer from the pmap structure.

Rearrange brackets in the fault cause detection in trap.c
Place the brackets correctly in order to see course of the conditions
instantaneously.

Unify naming in pmap-v6.c and improve style
Use naming common for whole pmap and compatible with other pmaps,
improve style where possible:
pm   -> pmap
pg   -> m
opg  -> om
*pt  -> *ptep
*pte -> *ptep
*pde -> *pdep

Submitted by:   Zbigniew Bodek <zbb@semihalf.com>
Sponsored by:   The FreeBSD Foundation, Semihalf

11 years agoSwitch to AP[2:1] access permissions model. Store "referenced"
gber [Thu, 23 May 2013 12:07:41 +0000 (12:07 +0000)]
Switch to AP[2:1] access permissions model. Store "referenced"
bit in PTE.

Enable Access Flag in CPU control. With AF enabled each valid mapping
needs to have referenced bit in PTE set in order to be able to cache
it in the TLB.

AP[0] bit is to be used as reference flag.
All access permissions are encoded by AP[2:1] wherein AP[1] is in fact
"user enable" and AP[2](APX) is "write disable".

All mappings are always set to be valid. Reference emulation is performed
by setting/clearing reference flag in PTE.

md.pvh_attrs are no longer necessary however pv_flags are still being used
for now.

Marking vm_page as "dirty" or "referenced" is being performed on:
- page or flag fault servicing in pmap_fault_fixup(), basing on the fault
  type
- vm_fault servicing in pmap_enter() according to the desired protections
  and faulty access type
Redundant page marking has been removed as on ARM we know exactly when the
particular page is referenced or is going to be written.

Submitted by: Zbigniew Bodek <zbb@semihalf.com>
Sponsored by: The FreeBSD Foundation, Semihalf

11 years agoWork around build breakages with GCC 4.2.
jkim [Thu, 23 May 2013 05:42:35 +0000 (05:42 +0000)]
Work around build breakages with GCC 4.2.

Reported by: tinderbox

11 years agoDon't depend on the touch binary being present.
ed [Wed, 22 May 2013 22:34:48 +0000 (22:34 +0000)]
Don't depend on the touch binary being present.

We can simply create an empty file by doing a no-op and redirecting stdout.

11 years agoFix loss of the emulated keyboard on Xen PV HVM domains.
gibbs [Wed, 22 May 2013 19:22:44 +0000 (19:22 +0000)]
Fix loss of the emulated keyboard on Xen PV HVM domains.

xen/xenbus/xenbusb.c:
    In xenbusb_probe_children(), do not modify the XenBus state of
    devices for which we have no PV driver support. An emulated device
    we do support may share this backend.  Hide the node from XenBus
    instead.

    This prevents closing the vkbd device, which Qemu's emulated keyboard
    device is using as the source for keyboard events.

    Tested with qemu-xen-traditional, qemu-xen and qemu stubdomains, all
    working as expected.

Submitted by: Roger Pau Monne <roger.pau@citrix.com>
Reviewed by: gibbs
MFC after: 1 week

11 years agoDon't mess with /etc/localtime if it is a symlink.
peter [Wed, 22 May 2013 19:00:05 +0000 (19:00 +0000)]
Don't mess with /etc/localtime if it is a symlink.

11 years agoImprove compatibility with old flex and fix build with GCC.
jkim [Wed, 22 May 2013 17:47:45 +0000 (17:47 +0000)]
Improve compatibility with old flex and fix build with GCC.

11 years agoCorrect panic on detach of Xen PV network interfaces.
gibbs [Wed, 22 May 2013 17:13:03 +0000 (17:13 +0000)]
Correct panic on detach of Xen PV network interfaces.

dev/xen/netfront:
    In netif_free(), properly stop the interface and drain any pending
    timers prior to disconnecting from the backend device.

    Remove all media and detach our interface object from the system
    prior to deleting it.

PR: kern/176471
Submitted by: Roger Pau Monne <roger.pau@citrix.com>
Reviewed by: gibbs
MFC after: 1 week

11 years agoRemove reference to removed !MPSAFE filesystem support
emaste [Wed, 22 May 2013 16:33:28 +0000 (16:33 +0000)]
Remove reference to removed !MPSAFE filesystem support

11 years agoIncrease the (arbitrary) limit for the number of packets per tick
luigi [Wed, 22 May 2013 16:32:18 +0000 (16:32 +0000)]
Increase the (arbitrary) limit for the number of packets per tick
from 1k to 20k The previous value was good 10 years ago, but not
anymore now.

More importantly, lots of good surprises:
polling is incredibly effective under virtualization, and not only
prevents livelock but also saves most of the VM exit overhead in
receive mode.

Using polling, a FreeBSD instance under qemu-kvm remains perfectly
responsive even when bombed with 10 Mpps over an emulated e1000,
and happily processes 1.7 Mpps through ipfw.

Note that some incompatibilities still remain: e.g. polling is not
(yet) compatible with netmap, and seems to freeze the guest when
kern.polling.idle_poll=1

MFC after: 3 days

11 years agoAcquire read lock on the src object for vm_fault_copy_entry().
attilio [Wed, 22 May 2013 15:11:00 +0000 (15:11 +0000)]
Acquire read lock on the src object for vm_fault_copy_entry().

Sponsored by: EMC / Isilon storage division
Reviewed by: alc

11 years agoFix a copy-and-paste typo.
delphij [Wed, 22 May 2013 05:21:19 +0000 (05:21 +0000)]
Fix a copy-and-paste typo.

11 years agoRegenerate with manual fixup for WITH_LDNS_UTILS inheriting WITHOUT_BIND_UTILS.
delphij [Wed, 22 May 2013 05:16:07 +0000 (05:16 +0000)]
Regenerate with manual fixup for WITH_LDNS_UTILS inheriting WITHOUT_BIND_UTILS.

11 years agoProperly spell sentinel (missed in 250891)
mckusick [Wed, 22 May 2013 05:07:55 +0000 (05:07 +0000)]
Properly spell sentinel (missed in 250891)
No functional changes.

Spotted by:  Navdeep Parhar and Alexey Dokuchaev
MFC after:   2 weeks

11 years agoFix NULL-dereference kernel panic in case of mps_attach() failure.
mav [Wed, 22 May 2013 02:15:07 +0000 (02:15 +0000)]
Fix NULL-dereference kernel panic in case of mps_attach() failure.

MFC after: 1 week

11 years agoImplement beacon event debugging in athalq.
adrian [Wed, 22 May 2013 01:03:41 +0000 (01:03 +0000)]
Implement beacon event debugging in athalq.

11 years agoAdd missing buffer releases (brelse) after bread calls that return
mckusick [Wed, 22 May 2013 00:57:22 +0000 (00:57 +0000)]
Add missing buffer releases (brelse) after bread calls that return
an error. One could argue that returning a buffer even when it is
not valid is incorrect, but bread has always returned a buffer
valid or not.

Reviewed by: kib
MFC after:   2 weeks

11 years agoAdd missing 28th element to softdep types name array.
mckusick [Wed, 22 May 2013 00:48:24 +0000 (00:48 +0000)]
Add missing 28th element to softdep types name array.

Found by:    Coverity Scan, CID 1007621
Reviewed by: kib
MFC after:   2 weeks

11 years agoNull a pointer after it is freed so that when it is returned
mckusick [Wed, 22 May 2013 00:40:26 +0000 (00:40 +0000)]
Null a pointer after it is freed so that when it is returned
the return value is NULL. Based on the returned flags, the
return value should never be inspected in the case where NULL
is returned, but it is good coding practice not to return a
pointer to freed memory.

Found by:    Coverity Scan, CID 1006096
Reviewed by: kib
MFC after:   2 weeks

11 years agoRemove a bogus check for a NULL buffer pointer.
mckusick [Wed, 22 May 2013 00:30:34 +0000 (00:30 +0000)]
Remove a bogus check for a NULL buffer pointer.
Add a KASSERT that it is not NULL.

Found by:    Coverity Scan, CID 1009114
Reviewed by: kib
MFC after:   2 weeks

11 years agoProperly spell sentinel (not sintenel or sentinal).
mckusick [Wed, 22 May 2013 00:17:50 +0000 (00:17 +0000)]
Properly spell sentinel (not sintenel or sentinal).
No functional changes.

Spotted by:  kib
MFC after:   2 weeks

11 years agopassing fd over unix socket: fix a corner case where caller
mjg [Tue, 21 May 2013 21:58:00 +0000 (21:58 +0000)]
passing fd over unix socket: fix a corner case where caller
wants to pass no descriptors.

Previously the kernel would leak memory and try to free a potentially
arbitrary pointer.

Reviewed by: pjd

11 years agoAdd proper prerequisites for even two more headers.
ed [Tue, 21 May 2013 21:50:11 +0000 (21:50 +0000)]
Add proper prerequisites for even two more headers.

Spotted by:   http://hacks.owlfolio.org/header-survey/

11 years agoUpdate manpages for r250887.
ed [Tue, 21 May 2013 21:39:18 +0000 (21:39 +0000)]
Update manpages for r250887.

Remove the lists of unneeded header files.

Requested by: eadler

11 years agoAllow certain headers to be included more easily.
ed [Tue, 21 May 2013 21:20:10 +0000 (21:20 +0000)]
Allow certain headers to be included more easily.

Spotted by: http://hacks.owlfolio.org/header-survey/

11 years agovm_object locking is not needed there as pages are already wired.
attilio [Tue, 21 May 2013 20:54:03 +0000 (20:54 +0000)]
vm_object locking is not needed there as pages are already wired.

Sponsored by: EMC / Isilon storage division
Submitted by: alc

11 years agoo Relax locking assertions for vm_page_find_least()
attilio [Tue, 21 May 2013 20:38:19 +0000 (20:38 +0000)]
o Relax locking assertions for vm_page_find_least()
o Relax locking assertions for pmap_enter_object() and add them also
  to architectures that currently don't have any
o Introduce VM_OBJECT_LOCK_DOWNGRADE() which is basically a downgrade
  operation on the per-object rwlock
o Use all the mechanisms above to make vm_map_pmap_enter() to work
  mostl of the times only with readlocks.

Sponsored by: EMC / Isilon storage division
Reviewed by: alc

11 years agoAdd <uchar.h>.
ed [Tue, 21 May 2013 19:59:37 +0000 (19:59 +0000)]
Add <uchar.h>.

The <uchar.h> header, part of C11, adds a small number of utility
functions for 16/32-bit "universal" characters, which may or may not be
UTF-16/32. As our wchar_t is already ISO 10646, simply add light-weight
wrappers around wcrtomb() and mbrtowc().

While there, also add (non-yet-standard) _l functions, similar to the
ones we already have for the other locale-dependent functions.

Reviewed by: theraven

11 years agoAvoid signed overflow in error handling code.
eadler [Tue, 21 May 2013 19:56:03 +0000 (19:56 +0000)]
Avoid signed overflow in error handling code.

Reviewed by: cperciva, bjk

11 years agoConnect flex 2.5.37 to the build and bump __FreeBSD_version.
jkim [Tue, 21 May 2013 19:32:35 +0000 (19:32 +0000)]
Connect flex 2.5.37 to the build and bump __FreeBSD_version.

11 years agoEnable GNU m4 compatibility mode.
jkim [Tue, 21 May 2013 19:23:49 +0000 (19:23 +0000)]
Enable GNU m4 compatibility mode.

11 years agoAllow YY_NO_UNPUT to disable unput() for backward compatibility.
jkim [Tue, 21 May 2013 19:22:42 +0000 (19:22 +0000)]
Allow YY_NO_UNPUT to disable unput() for backward compatibility.

11 years agoDefine yy_current_buffer for backward compatibility.
jkim [Tue, 21 May 2013 19:21:26 +0000 (19:21 +0000)]
Define yy_current_buffer for backward compatibility.

11 years agoDo not use log10(3) to get rid of libm dependency. It is really not useful.
jkim [Tue, 21 May 2013 19:20:03 +0000 (19:20 +0000)]
Do not use log10(3) to get rid of libm dependency.  It is really not useful.