]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoAudit sockaddr argument for bind(2), connect(2), accept(2), sendto(2) and
Pawel Jakub Dawidek [Thu, 7 Feb 2013 00:36:00 +0000 (00:36 +0000)]
Audit sockaddr argument for bind(2), connect(2), accept(2), sendto(2) and
recvfrom(2) syscalls.

Sponsored by: The FreeBSD Foundation

11 years agoMinor style tweaks.
Pawel Jakub Dawidek [Thu, 7 Feb 2013 00:27:11 +0000 (00:27 +0000)]
Minor style tweaks.

11 years agoAdd AUDIT_ARG_SOCKADDR() macro so we can start using the audit_arg_sockaddr()
Pawel Jakub Dawidek [Thu, 7 Feb 2013 00:24:23 +0000 (00:24 +0000)]
Add AUDIT_ARG_SOCKADDR() macro so we can start using the audit_arg_sockaddr()
function, which is currently unused.

Sponsored by: The FreeBSD Foundation

11 years agoAdd support for buttons on USB audio devices,
Hans Petter Selasky [Wed, 6 Feb 2013 17:43:05 +0000 (17:43 +0000)]
Add support for buttons on USB audio devices,
like Volume Up and Volume Down.

Reviewed by: mav @
MFC after: 1 week

11 years agoRework the handling of stop signals in the NFS client. The changes in
John Baldwin [Wed, 6 Feb 2013 17:06:51 +0000 (17:06 +0000)]
Rework the handling of stop signals in the NFS client.  The changes in
195702, 195703, and 195821 prevented a thread from suspending while holding
locks inside of NFS by forcing the thread to fail sleeps with EINTR or
ERESTART but defer the thread suspension to the user boundary.  However,
this had the effect that stopping a process during an NFS request could
abort the request and trigger EINTR errors that were visible to userland
processes (previously the thread would have suspended and completed the
request once it was resumed).

This change instead effectively masks stop signals while in the NFS client.
It uses the existing TDF_SBDRY flag to effect this since SIGSTOP cannot
be masked directly.  Also, instead of setting PBDRY on individual sleeps,
the NFS client now sets the TDF_SBDRY flag around each NFS request and
stop signals are masked for all sleeps during that region (the previous
change missed sleeps in lockmgr locks).  The end result is that stop
signals sent to threads performing an NFS request are completely
ignored until after the NFS request has finished processing and the
thread prepares to return to userland.  This restores the behavior of
stop signals being transparent to userland processes while still
preventing threads from suspending while holding NFS locks.

Reviewed by: kib
MFC after: 1 month

11 years agoPrezero the acl structure which is to be copied to usermode, to avoid
Sergey Kandaurov [Wed, 6 Feb 2013 15:18:46 +0000 (15:18 +0000)]
Prezero the acl structure which is to be copied to usermode, to avoid
leakage of the previous content of padding and unitialized fields.

Reported by: Ilia Noskov <noskov@nic.ru>
Reviewed by: kib
MFC after: 1 week

11 years agoMake sure that all mouse buttons are released when clients
Hans Petter Selasky [Wed, 6 Feb 2013 11:16:18 +0000 (11:16 +0000)]
Make sure that all mouse buttons are released when clients
using /dev/consolectl close. This fixes a problem where if
a USB mouse is detached while a button is pressed, that
button is never released.

MFC after: 1 week

11 years agoFixes to QUEUE_MACRO_DEBUG support:
Gleb Smirnoff [Wed, 6 Feb 2013 07:27:25 +0000 (07:27 +0000)]
Fixes to QUEUE_MACRO_DEBUG support:
 - Add const quilifiers to fields that store value of __FILE__.
 - Use long type for fields that store value of __LINE__.
 - Sort and style(9) debugging fields.
 - Add initializer for debugging fields into TAILQ_INITIALIZER macro.

PR: 175759
Submitted by: Andrey Simonenko <simon comsys.ntu-kpi.kiev.ua>
Reviewed by: bde

11 years agoBusy-wait when cold.
Navdeep Parhar [Wed, 6 Feb 2013 06:44:42 +0000 (06:44 +0000)]
Busy-wait when cold.

Reported by: gnn, jhb
MFC after: 3 days

11 years agoCompute the number of initial kernel page table pages (NKPT) dynamically.
Neel Natu [Wed, 6 Feb 2013 04:53:00 +0000 (04:53 +0000)]
Compute the number of initial kernel page table pages (NKPT) dynamically.

This eliminates the need to recompile the kernel when the default value
of NKPT is not big enough - for e.g. when loading large kernel modules
or memory disk images from the loader.

If NKPT is defined in the kernel configuration file then it overrides the
dynamic calculation.

Reviewed by: alc, kib

11 years agoUse and set gpio pin to high to power up usb.
Ganbold Tsagaankhuu [Wed, 6 Feb 2013 01:03:13 +0000 (01:03 +0000)]
Use and set gpio pin to high to power up usb.

Approved by: gonzo@

11 years agoAdd the __aeabi_mem* functions to compiler-rt as clang uses them.
Andrew Turner [Wed, 6 Feb 2013 00:01:28 +0000 (00:01 +0000)]
Add the __aeabi_mem* functions to compiler-rt as clang uses them.

11 years agosh: Do not test for digit_contig in mksyntax.
Jilles Tjoelker [Tue, 5 Feb 2013 22:54:09 +0000 (22:54 +0000)]
sh: Do not test for digit_contig in mksyntax.

ISO/IEC 9899:1999 (E) 5.2.1p3 guarantees that the values of the characters
0123456789 are contiguous.

The generated syntax.c and syntax.h remain the same.

Submitted by: Christoph Mallon

11 years agoRemove reference to the rlist code from comments, and fix a typo visible
Sergey Kandaurov [Tue, 5 Feb 2013 20:08:33 +0000 (20:08 +0000)]
Remove reference to the rlist code from comments, and fix a typo visible
in the resulted change.

Reviewed by: kib
MFC after: 1 week

11 years ago* Add the integer div & mod functions and ARM EABI support functions to
Andrew Turner [Tue, 5 Feb 2013 20:03:58 +0000 (20:03 +0000)]
* Add the integer div & mod functions and ARM EABI support functions to
  libstand.
* Stop linking the ARM U-Boot loader against libgcc now libstand has the
  required symbols.

11 years agoInstall <dev/agp/agpreg.h> and <dev/pci/pcireg.h> as userland headers
John Baldwin [Tue, 5 Feb 2013 18:55:09 +0000 (18:55 +0000)]
Install <dev/agp/agpreg.h> and <dev/pci/pcireg.h> as userland headers
in /usr/include.

MFC after: 2 weeks

11 years agoAdd defines to more easily allow a single threaded version of the FreeBSD
Hans Petter Selasky [Tue, 5 Feb 2013 14:44:25 +0000 (14:44 +0000)]
Add defines to more easily allow a single threaded version of the FreeBSD
USB stack. This is useful for non-kernel purposes, like the loader.

11 years agoRemove political propaganda
Dag-Erling Smørgrav [Tue, 5 Feb 2013 14:39:37 +0000 (14:39 +0000)]
Remove political propaganda

11 years agoBump .Dd for the change in r246121.
Niclas Zeising [Tue, 5 Feb 2013 14:29:37 +0000 (14:29 +0000)]
Bump .Dd for the change in r246121.

Approved by: joel (mentor)

11 years agoFix some nits.
Hans Petter Selasky [Tue, 5 Feb 2013 13:30:07 +0000 (13:30 +0000)]
Fix some nits.

11 years agoFix depend target.
Hans Petter Selasky [Tue, 5 Feb 2013 12:37:50 +0000 (12:37 +0000)]
Fix depend target.

11 years agoLoad the pfsync module if necessary.
Dag-Erling Smørgrav [Tue, 5 Feb 2013 12:18:39 +0000 (12:18 +0000)]
Load the pfsync module if necessary.

Reviewed by: glebius@
MFC after: 1 week

11 years agoBuild clang for little-endian arm by default. Due to size issues when built
Andrew Turner [Tue, 5 Feb 2013 05:16:02 +0000 (05:16 +0000)]
Build clang for little-endian arm by default. Due to size issues when built
with gcc disable CLANG_FULL for now.

11 years agoRemove two dead assignments and
Ganbold Tsagaankhuu [Tue, 5 Feb 2013 04:13:34 +0000 (04:13 +0000)]
Remove two dead assignments and
make use of sc more explicit and clear

Submitted by: Christoph Mallon
Approved by: gonzo@

11 years agoext2fs: move assignment where it is not dead.
Pedro F. Giffuni [Tue, 5 Feb 2013 03:26:34 +0000 (03:26 +0000)]
ext2fs: move assignment where it is not dead.

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoext2fs: Remove unused em_e2fsb definition..
Pedro F. Giffuni [Tue, 5 Feb 2013 03:23:56 +0000 (03:23 +0000)]
ext2fs: Remove unused em_e2fsb definition..

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoext2fs: Remove useless rootino local variable.
Pedro F. Giffuni [Tue, 5 Feb 2013 03:17:41 +0000 (03:17 +0000)]
ext2fs: Remove useless rootino local variable.

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoext2fs: Correct off-by-one errors in FFTODT() and DDTOFT().
Pedro F. Giffuni [Tue, 5 Feb 2013 03:13:05 +0000 (03:13 +0000)]
ext2fs: Correct off-by-one errors in FFTODT() and DDTOFT().

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoext2fs: Use nitems().
Pedro F. Giffuni [Tue, 5 Feb 2013 03:08:56 +0000 (03:08 +0000)]
ext2fs: Use nitems().

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoext2fs: Use EXT2_LINK_MAX instead of LINK_MAX
Pedro F. Giffuni [Tue, 5 Feb 2013 03:01:04 +0000 (03:01 +0000)]
ext2fs: Use EXT2_LINK_MAX instead of LINK_MAX

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agocrunchgen: Permit use of alternative linkers.
Pedro F. Giffuni [Tue, 5 Feb 2013 02:57:59 +0000 (02:57 +0000)]
crunchgen: Permit use of alternative linkers.

Submitted by: Pete Chou
MFC after: 1 week

11 years agoAdd gpio driver and update dts and kernel config accordingly.
Ganbold Tsagaankhuu [Tue, 5 Feb 2013 02:25:13 +0000 (02:25 +0000)]
Add gpio driver and update dts and kernel config accordingly.

Approved by: gonzo@

11 years agoRework jumbo frame handling. QAC confirmed that the controller
Pyun YongHyeon [Tue, 5 Feb 2013 00:37:45 +0000 (00:37 +0000)]
Rework jumbo frame handling.  QAC confirmed that the controller
requires 8 bytes alignment on RX buffer.  Given that non-jumbo
frame works on any alignments I guess this DMA limitation for RX
buffer could be jumbo frame specific one.  Also I'm not sure
whether this DMA limitation is related with 64bit DMA.  Previously
age(4) disabled 64bit DMA addressing due to silent data corruption.
So we may need more testing on re-enabling 64bit DMA in future.

While I'm here, change mbuf chaining algorithm to use fixed sized
buffer and force software checksum if controller reports length
error. According to QAC, RFD is not updated at all for jumbo frame
so it works just like alc(4) controllers.  This change also added
alignment fixup for strict alignment architectures.  Because I'm
not aware of any non-x86 machines that use age(4) controllers it's
just for completeness at this moment.

Wit this change, jumbo frame should work with age(4).

Tested by: Christian Gusenbauer < c47g <> gmx dot at >
MFC after: 1 week

11 years agoktr: prevent possible footshooting with KTR_ENTRIES and KTR_BOOT_ENTRIES
Andriy Gapon [Mon, 4 Feb 2013 21:58:57 +0000 (21:58 +0000)]
ktr: prevent possible footshooting with KTR_ENTRIES and KTR_BOOT_ENTRIES

Suggested by: adrian
MFC after: 14 days
X-MFC with: r246282

11 years agoktr: copy content from the early static buffer if KTR_ENTRIES !=
Andriy Gapon [Mon, 4 Feb 2013 21:50:55 +0000 (21:50 +0000)]
ktr: copy content from the early static buffer if KTR_ENTRIES !=
KTR_BOOT_ENTRIES

Reported by: glebius, jhb
Pointyhat to: avg
MFC after: 14 days
X-MFC with: r246282

11 years agoUse stripesize as smallest block size if it's available.
Xin LI [Mon, 4 Feb 2013 19:17:15 +0000 (19:17 +0000)]
Use stripesize as smallest block size if it's available.

MFC after: 2 weeks

11 years agoSort by MK_* knob like the comment says
Dag-Erling Smørgrav [Mon, 4 Feb 2013 19:05:53 +0000 (19:05 +0000)]
Sort by MK_* knob like the comment says

MFC after: 1 week

11 years agoMissed adding Makefile.config and unit-tests/Makefile should
Simon J. Gerraty [Mon, 4 Feb 2013 17:41:17 +0000 (17:41 +0000)]
Missed adding Makefile.config and unit-tests/Makefile should
allow FreeBSD make to do 'obj'.

Approved by: marcel (mentor)

11 years agong_ether_ifnet_arrival_event: check interface type before using IFP2NG
Andriy Gapon [Mon, 4 Feb 2013 17:29:13 +0000 (17:29 +0000)]
ng_ether_ifnet_arrival_event: check interface type before using IFP2NG

The check is copied from vnet_ng_ether_init.
Not sure if it covers all the types that we want to support with
ng_ether.

Reported by: markj
Discussed with: zec
MFC after: 10 days
X-MFC with: r246245

11 years agoCast *tabchar, a wchar_t, to a wint_t as it is the type the %lc printf
Andrew Turner [Mon, 4 Feb 2013 10:05:55 +0000 (10:05 +0000)]
Cast *tabchar, a wchar_t, to a wint_t as it is the type the %lc printf
format string expects. This is only an issue on ARM EABI where wint_t is
different to wchar_t.

11 years agoUse the STACKALIGN macro to alight the stack rather than with a magic mask.
Andrew Turner [Mon, 4 Feb 2013 09:48:50 +0000 (09:48 +0000)]
Use the STACKALIGN macro to alight the stack rather than with a magic mask.

Submitted by: Christoph Mallon <christoph.mallon gmx.de>

11 years agoAdd #undef TARGET_DEFAULT back as it shouldn't have been removed in r245539
Andrew Turner [Mon, 4 Feb 2013 09:42:12 +0000 (09:42 +0000)]
Add #undef TARGET_DEFAULT back as it shouldn't have been removed in r245539

11 years agoTry to improve r242655 take III: move these SYSCTLs describing the kernel
Marius Strobl [Mon, 4 Feb 2013 09:35:48 +0000 (09:35 +0000)]
Try to improve r242655 take III: move these SYSCTLs describing the kernel
map, which is defined and initialized in vm/vm_kern.c, to the latter.

Submitted by: alc

11 years agoFix xdev by using the install shell script as it knows about the -l
Andrew Turner [Mon, 4 Feb 2013 09:34:25 +0000 (09:34 +0000)]
Fix xdev by using the install shell script as it knows about the -l
argument thile the local version install may not.

11 years agoAllow the unwind functions int libgcc_s to interact correctly with libthr.
Andrew Turner [Mon, 4 Feb 2013 09:28:36 +0000 (09:28 +0000)]
Allow the unwind functions int libgcc_s to interact correctly with libthr.

_Unwind_ForcedUnwind in libgcc_s takes as one of it's parameters a stop
function to tell it when to stop unwinding. One of the stop function's
parameters is a _Unwind_Exception_Class. On most architectures this is an
int64_t, however on ARM EABI the gcc developers have made this a char array
with 8 items. While both of these take the same space they are passed into
the stop function differently, an int64_t is passed in in registers r2 and
r3, while the char[8] is passed in as a pointer to the first item in
register r2.

Because libthr expects the value to be an int64_t we would get incorrect
results when it passes a function that take an int64_t but libgcc passes in
a pointer to a char array including crashing.

The fix is to update libgcc_s to make it pass an int64_t to the stop
function and to libstdc++ as it expects _Unwind_Exception_Class to be an
array.

11 years agoExtend GDB to check the value in the .note.tag section along with the
Andrew Turner [Mon, 4 Feb 2013 06:59:33 +0000 (06:59 +0000)]
Extend GDB to check the value in the .note.tag section along with the
.note.ABI-tag section.

This helps on ARM EABI where the OS/ABI field is zero. It would be better
to use the NOTES program header however this would require a more invasive
change.

11 years agoFurther improve r242655 and supply VM_{MIN,MAX}_KERNEL_ADDRESS as constant
Marius Strobl [Sun, 3 Feb 2013 21:43:55 +0000 (21:43 +0000)]
Further improve r242655 and supply VM_{MIN,MAX}_KERNEL_ADDRESS as constant
values to SYSCTL_ULONG(9) where possible.

Submitted by: bde

11 years ago- Make pci_ns8250_ids[] const.
Marius Strobl [Sun, 3 Feb 2013 21:30:29 +0000 (21:30 +0000)]
- Make pci_ns8250_ids[] const.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

MFC after: 1 week

11 years agoUFS: Remove dead assignment.
Pedro F. Giffuni [Sun, 3 Feb 2013 21:30:02 +0000 (21:30 +0000)]
UFS: Remove dead assignment.

Submitted by: Christoph Mallon
MFC after: 3 days

11 years agocrunchide(1): Put e_shnum into a local variable.
Pedro F. Giffuni [Sun, 3 Feb 2013 21:16:33 +0000 (21:16 +0000)]
crunchide(1): Put e_shnum into a local variable.

This simplifies the code a bit.

Submitted by: Cristoph Mallon
MFC after: 2 weeks

11 years agoAdd several missing symbols to libcxxrt's symbol version map, and remove
Dimitry Andric [Sun, 3 Feb 2013 20:40:41 +0000 (20:40 +0000)]
Add several missing symbols to libcxxrt's symbol version map, and remove
a few duplicates.  This should fix building world with -stdlib=libc++
after r246028.

Submitted by: Yamaya Takashi <yamayan@kbh.biglobe.ne.jp>
MFC after: 1 week
X-MFC-With: r246028

11 years agocrunchide(1): support non-custom elf object layout
Pedro F. Giffuni [Sun, 3 Feb 2013 20:35:37 +0000 (20:35 +0000)]
crunchide(1): support non-custom elf object layout

The crunchide utility presumes the last 3 chunks of an ELF object
layout are section headers, symbol table, and then string table.
However, this is  not specified in the ELF standards, and linkers
may generate different layouts when doing partial linking (-r).

This change is required to build FreeBSD with mclinker or the
gold linker.

PR: bin/174011
Submitted by: Pete Chou
Reviewed by: Cristoph Mallon
MFC after: 2 weeks

11 years agozfs: fix, improve and re-organize page_lookup and page_unlock
Andriy Gapon [Sun, 3 Feb 2013 18:42:20 +0000 (18:42 +0000)]
zfs: fix, improve and re-organize page_lookup and page_unlock

Now they are split into two pairs: page_hold/page_unhold for mappedread
and page_busy/page_unbusy for update_pages.

For mappedread we simply hold a page that is to be used as a source if it
is resident and valid (and not busy).  This is sufficient since we are
only doing page -> user buffer copying.  There is no page <-> backing
storage I/O involved.

update_pages is now better split to properly handle the putpages case
(page -> arc) and the regular write case (arc -> page).

For the latter we use complete protocol of marking an object with
paging-in-progress and marking a page with io_start (busy count).
Also, in this case we remove the write bit from all page mappings and
clear dirty bits of the pages, the former is needed to ensure that the
latter does the right thing.
Additionally we update a page if it is cached instead of just freeing it
as was done before.  This needs to be verified.

A minor detail: ZFS-backed pages should always be either fully valid
or fully invalid.  Assert this and use simpler API that does not deal
with sub-page blocks.

Reviewed by: kib
MFC after: 26 days

11 years agoFor UFS2 i_blocks is unsigned. The current "sanity" check that it
Kirk McKusick [Sun, 3 Feb 2013 17:16:32 +0000 (17:16 +0000)]
For UFS2 i_blocks is unsigned. The current "sanity" check that it
has gone below zero after the blocks in its inode are freed is a
no-op which the compiler fails to warn about because of the use of
the DIP macro. Change the sanity check to compare the number of
blocks being freed against the value i_blocks. If the number of
blocks being freed exceeds i_blocks, just set i_blocks to zero.

Reported by: Pedro Giffuni (pfg@)
MFC after:   2 weeks

11 years agosh: Expand here documents in the current process.
Jilles Tjoelker [Sun, 3 Feb 2013 15:54:57 +0000 (15:54 +0000)]
sh: Expand here documents in the current process.

Expand here documents at the same point other redirections are expanded but
use a non-fork subshell environment (like simple command substitutions) for
compatibility. Substitition errors result in an empty here document like
before.

As a result, a fork is avoided for short (<4K) expanded here documents.

Unexpanded here documents (with quoted end marker after <<) are not affected
by this change. They already only forked when >4K.

Side effects:
* Order of expansion is slightly different.
* Slow expansions are not executed in parallel with the redirected command.
* A non-fork subshell environment is subtly different from a forked process.

11 years ago- Add CHECKSUM.* support in Makefile[1].
Hiroki Sato [Sun, 3 Feb 2013 10:26:24 +0000 (10:26 +0000)]
- Add CHECKSUM.* support in Makefile[1].
- Use ln -fs to create a symlink.
- Remove pkgadd for docports.
- Use WITHOUT_JADETEX=yes instead of WITH_JADETEX=no.
- Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE.
- Use makefs(8) and gpart(8) for sparc64 ISO image[2].
- Add publisher option to makefs(8)[2].

Based on work by: gjb[1]
Discussed with: marius, nwhitehorn[2]

11 years agoallow for large KTR_ENTRIES values by allocating ktr_buf using malloc(9)
Andriy Gapon [Sun, 3 Feb 2013 09:57:39 +0000 (09:57 +0000)]
allow for large KTR_ENTRIES values by allocating ktr_buf using malloc(9)

Only during very early boot, before malloc(9) is functional (SI_SUB_KMEM),
the static ktr_buf_init is used.  Size of the static buffer is determined
by a new kernel option KTR_BOOT_ENTRIES.  Its default value is 1024.

This commit builds on top of r243046.

Reviewed by: alc
MFC after: 17 days

11 years agocrunch: Sync some NetBSD changes
Pedro F. Giffuni [Sun, 3 Feb 2013 01:54:25 +0000 (01:54 +0000)]
crunch: Sync some NetBSD changes

Fix a couple of free's in previous commit.

Obtained from: NetBSD
MFC after: 1 week

11 years agoAnother overhaul of the CPSW driver for BeagleBone
Tim Kientzle [Sun, 3 Feb 2013 01:08:01 +0000 (01:08 +0000)]
Another overhaul of the CPSW driver for BeagleBone

Major changes:
  * Finally tracked down the flow control setting that
    seems to have been causing TX stalls and watchdog timeouts
  * RX and TX paths now share a lot more code
  * TX interrupt is no longer used; we instead GC finished
    tx queue entries at the bottom of the start routine.
  * TX start now queues fragmented packets directly; it only
    invokes defrag() for occasional very fragmented packets.
  * "sysctl dev.cpsw" dumps controller statistics and queue counts
  * Host Error Interrupt will give extensive debugging information
    if the controller chokes on the queued data.

11 years agoFix the PowerPC DTrace copy functions. The kernel doesn't hold the same view to
Justin Hibbits [Sun, 3 Feb 2013 00:19:34 +0000 (00:19 +0000)]
Fix the PowerPC DTrace copy functions.  The kernel doesn't hold the same view to
the user map, so use the md copy in/out functions provided by the kernel.

MFC with: r242723

11 years agoRegenerate src.conf(5).
Dimitry Andric [Sat, 2 Feb 2013 22:52:24 +0000 (22:52 +0000)]
Regenerate src.conf(5).

11 years agoAdd missing src.conf(5) fragments for WITHOUT_LIBCPLUSPLUS and WITH_GPL_DTC.
Dimitry Andric [Sat, 2 Feb 2013 22:42:46 +0000 (22:42 +0000)]
Add missing src.conf(5) fragments for WITHOUT_LIBCPLUSPLUS and WITH_GPL_DTC.

11 years agocrunch: Sync some NetBSD changes
Pedro F. Giffuni [Sat, 2 Feb 2013 22:39:21 +0000 (22:39 +0000)]
crunch: Sync some NetBSD changes

Revert a comment that was not supposed to go away.

Obtained from: NetBSD

11 years agoRegenerate src.conf(5).
Dimitry Andric [Sat, 2 Feb 2013 22:36:02 +0000 (22:36 +0000)]
Regenerate src.conf(5).

11 years agoPull in r170135 from upstream clang trunk:
Dimitry Andric [Sat, 2 Feb 2013 22:28:29 +0000 (22:28 +0000)]
Pull in r170135 from upstream clang trunk:

  Dont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the user
  specifies not to. Dont build ASTMatchers with Rewriter disabled and
  StaticAnalyzer when it's disabled.

  Without all those three, the clang binary shrinks (x86_64) from ~36MB
  to ~32MB (unstripped).

To disable these clang components, and get a smaller clang binary built
and installed, set WITHOUT_CLANG_FULL in src.conf(5).  During the
initial stages of buildworld, those extra components are already
disabled automatically, to save some build time.

MFC after: 1 week

11 years agoext2fs: general cleanup.
Pedro F. Giffuni [Sat, 2 Feb 2013 22:23:45 +0000 (22:23 +0000)]
ext2fs: general cleanup.

- Remove unused extern declarations in fs.h
- Correct comments in ext2_dir.h
- Several panic() messages showed wrong function names.
- Remove commented out stray line in ext2_alloc.c.
- Remove the unused macro EXT2_BLOCK_SIZE_BITS() and the then
  write-only member e2fs_blocksize_bits from struct m_ext2fs.
- Remove the unused macro EXT2_FIRST_INO() and the then write-only
  member e2fs_first_inode from struct m_ext2fs.
- Remove EXT2_DESC_PER_BLOCK() and the member e2fs_descpb from
  struct m_ext2fs.
- Remove the unused members e2fs_bmask, e2fs_dbpg and
  e2fs_mount_opt from struct m_ext2fs
- Correct harmless off-by-one error for fspath in ext2_vfsops.c.
- Remove the unused and broken macros EXT2_ADDR_PER_BLOCK_BITS()
  and EXT2_DESC_PER_BLOCK_BITS().
- Remove the !_KERNEL versions of the EXT2_* macros.

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoImprove r238673 to additionally allow for odd-aligned buffers as
Marius Strobl [Sat, 2 Feb 2013 21:57:06 +0000 (21:57 +0000)]
Improve r238673 to additionally allow for odd-aligned buffers as
passed in by smartd of smartmontools.
While at it, hint the compiler that 32-bit PIO is the most likely
case (idea from Linux) and use bus_{read,write}_stream_2(9) instead
of bus_{read,write}_multi_stream_2(9) for single count reads/writes.

MFC after: 1 week

11 years agocrunch: Sync some NetBSD changes.
Pedro F. Giffuni [Sat, 2 Feb 2013 21:51:14 +0000 (21:51 +0000)]
crunch: Sync some NetBSD changes.

crunchide:
Apr 11, 2009: fix some -Wsign-compare issues.
Sep 20, 1999: Free the right thing.

crunchgen:
Apr 14, 2009: Fix some WARNS=4 issues (-Wshadow -Wcast-qual)
Oct 30, 2004: Add (unsigned char) cast to ctype functions
Feb 5, 2001: fix nested extern.

examples:
Aug 30, 2007: NetBSD 36867 - trsp references are deprecated

Obtained from: NetBSD
MFC after: 1 week

11 years agoUse the default policy table of RFC 6724.
Hajimu UMEMOTO [Sat, 2 Feb 2013 18:08:09 +0000 (18:08 +0000)]
Use the default policy table of RFC 6724.

MFC after: 1 weeks

11 years agofix some fat-fingering in r246246
Andriy Gapon [Sat, 2 Feb 2013 14:19:50 +0000 (14:19 +0000)]
fix some fat-fingering in r246246

Submitted by: mjg
Pointyhat to: avg
MFC after: 5 days
X-MFC with: r246246

11 years agorevert accidentally committed unneeded changes from r246250
Andriy Gapon [Sat, 2 Feb 2013 12:52:43 +0000 (12:52 +0000)]
revert accidentally committed unneeded changes from r246250

MFC after: 7 days
X-MFC with: r246250

11 years agoacpi: clear power button status bit after waking up...
Andriy Gapon [Sat, 2 Feb 2013 12:44:19 +0000 (12:44 +0000)]
acpi: clear power button status bit after waking up...

so that it is not confused for a new power off request.

Learned from: Linux and ACPI specification
Tested by: gjb
MFC after: 12 days

11 years agoacpi: after wakeup from a state > S1 re-enable SCI_EN with a direct write
Andriy Gapon [Sat, 2 Feb 2013 12:42:07 +0000 (12:42 +0000)]
acpi: after wakeup from a state > S1 re-enable SCI_EN with a direct write

This hack is picked up from Linux, which claims that it follows
Windows behavior.

PR: amd64/174409
Tested by: Sergey V. Dyatko <sergey.dyatko@gmail.com>,
KAHO Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>,
Slawa Olhovchenkov <slw@zxy.spb.ru>
MFC after: 13 days

11 years agocpususpend_handler: mark AP as resumed only after fully setting up lapic
Andriy Gapon [Sat, 2 Feb 2013 12:04:32 +0000 (12:04 +0000)]
cpususpend_handler: mark AP as resumed only after fully setting up lapic

Reviewed by: jhb
Tested by: Sergey V. Dyatko <sergey.dyatko@gmail.com>,
KAHO Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
MFC after: 12 days

11 years agox86 suspend/resume: suspend pics and pseudo-pics in reverse order
Andriy Gapon [Sat, 2 Feb 2013 12:02:42 +0000 (12:02 +0000)]
x86 suspend/resume: suspend pics and pseudo-pics in reverse order

- change 'pics' from STAILQ to TAILQ
- ensure that Local APIC is always first in 'pics'

Reviewed by: jhb
Tested by: Sergey V. Dyatko <sergey.dyatko@gmail.com>,
KAHO Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
MFC after: 12 days

11 years agoprint compiler version in the kernel banner
Andriy Gapon [Sat, 2 Feb 2013 11:58:35 +0000 (11:58 +0000)]
print compiler version in the kernel banner

And provide kernel compiler version as a sysctl as well.
This is useful while we have gcc and clang cohabitation.
This could be even more useful when we have support
for external toolchains.

In cooperation with: mjg
MFC after: 13 days

11 years agong_ether: track interface renaming
Andriy Gapon [Sat, 2 Feb 2013 11:54:00 +0000 (11:54 +0000)]
ng_ether: track interface renaming

Also sanitize interface names that can potentially contain characters
that are prohibited in netgraph names.

PR: kern/154850 (sanitizing of names)
Discussed with: eri, melifaro
Submitted by: Nikolay Denev <ndenev@gmail.com> (sanitizing code)
Reviewed by: eri, glebius
MFC after: 17 days

11 years agosolaris compat: remove KM_ZERO
Andriy Gapon [Sat, 2 Feb 2013 11:41:05 +0000 (11:41 +0000)]
solaris compat: remove KM_ZERO

- there is no such flag in Solaris and derivatives
- the flag was added in an unrelated change
- the flag is not used

The proper way to allocate zeroed out memory is to use kmem_zalloc.

MFC after: 3 days

11 years agouart: add resume method and enable it for attachments on the most common
Andriy Gapon [Sat, 2 Feb 2013 11:38:26 +0000 (11:38 +0000)]
uart: add resume method and enable it for attachments on the most common
x86 buses

Otherwise the uart hardware could be in such a state after the resume
where IER is cleared and thus no interrupts are generated.

This behavior is observed and tested with QEMU, so I am comitting this
change to help with my debugging.
There has been no feedback from users of serial ports on real hardware.

MFC after: 20 days

11 years agozfs: add MODULE_VERSION for zfsctrl
Andriy Gapon [Sat, 2 Feb 2013 11:35:18 +0000 (11:35 +0000)]
zfs: add MODULE_VERSION for zfsctrl

This should allow the kernel linker to easily detect a situation
when the module is present both in a kernel and in a preloaded file
(zfs.ko).

Reviewed by: jhb
MFC after: 5 days

11 years agoFix an obvious typo that broke time specifications of the form
Tim Kientzle [Sat, 2 Feb 2013 06:06:39 +0000 (06:06 +0000)]
Fix an obvious typo that broke time specifications of the form
"2 hours ago".

11 years agoTweaks to standard BEAGLEBONE config, as recently discussed
Tim Kientzle [Sat, 2 Feb 2013 06:01:57 +0000 (06:01 +0000)]
Tweaks to standard BEAGLEBONE config, as recently discussed
on FreeBSD-ARM.

11 years agoAllow IEEE80211_SUPPORT_SUPERG to be defined _and_ have a working wlan
Adrian Chadd [Sat, 2 Feb 2013 02:00:29 +0000 (02:00 +0000)]
Allow IEEE80211_SUPPORT_SUPERG to be defined _and_ have a working wlan
module.

11 years agoWrap this in an #ifdef so IEEE80211_SUPPORT_SUPERG will work correctly
Adrian Chadd [Sat, 2 Feb 2013 02:00:10 +0000 (02:00 +0000)]
Wrap this in an #ifdef so IEEE80211_SUPPORT_SUPERG will work correctly
in a wlan.ko module.

11 years agoMerge bmake-20130123
Simon J. Gerraty [Fri, 1 Feb 2013 22:55:27 +0000 (22:55 +0000)]
Merge bmake-20130123

Approved by: marcel (mentor)

11 years agoRemove support for plip from the GENERIC kernel as no systems in the
Eitan Adler [Fri, 1 Feb 2013 20:17:11 +0000 (20:17 +0000)]
Remove support for plip from the GENERIC kernel as no systems in the
last 10 years require this support.

Discussed with: db
Discussed with: kib
Reviewed by: imp
Reviewed by: jhb
Reviewed by: -hackers
Approved by: cperciva (mentor)

11 years agoDisplay MSI-X table and PBA offsets when displaying information about MSI-X
Neel Natu [Fri, 1 Feb 2013 19:24:16 +0000 (19:24 +0000)]
Display MSI-X table and PBA offsets when displaying information about MSI-X
capability.

Reviewed by: jhb, jimharris (initial version)

11 years agoThe MSDOSFSMNT_WAITONFAT flag is bogus and broken. It does less than
Konstantin Belousov [Fri, 1 Feb 2013 18:30:41 +0000 (18:30 +0000)]
The MSDOSFSMNT_WAITONFAT flag is bogus and broken.  It does less than
track the MNT_SYNCHRONOUS flag.  It is set to the latter at mount time
but not updated by MNT_UPDATE.

Use MNT_SYNCHRONOUS to decide to write the FAT updates syncrhonously.

Submitted by: bde
MFC after: 1 week

11 years agoBackup FATs were sometimes marked dirty by copying their first block
Konstantin Belousov [Fri, 1 Feb 2013 18:25:53 +0000 (18:25 +0000)]
Backup FATs were sometimes marked dirty by copying their first block
from the primary FAT, and then they were not marked clean on unmount.
Force marking them clean when appropriate.

Submitted by: bde
MFC after: 1 week

11 years agoThe directory entry for dotdot was corrupted in the FAT32 case when moving
Konstantin Belousov [Fri, 1 Feb 2013 18:06:06 +0000 (18:06 +0000)]
The directory entry for dotdot was corrupted in the FAT32 case when moving
a directory to a subdir of the root directory from somewhere else.

For all directory moves that change the parent directory, the dotdot
entry must be fixed up.  For msdosfs, the root directory is magic for
non-FAT32.  It is less magic for FAT32, but needs the same magic for
the dotdot fixup.  It didn't have it.

Both chkdsk and fsck_msdosfs fix the corrupt directory entries with no
problems.

The fix is to use the same magic for dotdot in msdosfs_rename() as in
msdosfs_mkdir().

For msdosfs_mkdir(), document the magic. When writing the dotdot entry
in mkdir, use explicitly set pcl variable instead on relying on the
start cluster of the root directory typically has a value < 65536.

Submitted by: bde
MFC after: 1 week

11 years agoThe mountmsdosfs() function had an insane sanity test, remove it.
Konstantin Belousov [Fri, 1 Feb 2013 18:01:03 +0000 (18:01 +0000)]
The mountmsdosfs() function had an insane sanity test, remove it.

Trying FAT32 on a small partition failed to mount because
pmp->pm_Sectors was nonzero.  Normally, FAT32 file systems are so
large that the 16-bit pm_Sectors can't hold the size.  This is
indicated by setting it to 0 and using only pm_HugeSectors.  But at
least old versions of newfs_msdos use the 16-bit field if possible,
and msdosfs supports this except for breaking its own support in the
sanity check.  This is quite different from the handling of pm_FATsecs
-- now the 16-bit value is always ignored for FAT32 except for
checking that it is 0, and newfs_msdos doesn't use the 16-bit value
for FAT32.

Submitted by: bde
MFC after: 1 week

11 years agoFix a backwards comment in markvoldirty().
Konstantin Belousov [Fri, 1 Feb 2013 17:58:37 +0000 (17:58 +0000)]
Fix a backwards comment in markvoldirty().

Submitted by: bde
MFC after: 1 week

11 years agoAdd support for MSI-X interrupts in the virtio block device and make that
Neel Natu [Fri, 1 Feb 2013 16:58:59 +0000 (16:58 +0000)]
Add support for MSI-X interrupts in the virtio block device and make that
the default.

The current behavior of advertising a single MSI vector can be requested by
setting the environment variable "BHYVE_USE_MSI" to "yes". The use of MSI
is not compliant with the virtio specification and will be eventually phased
out.

Submitted by: Gopakumar T
Obtained from: NetApp

11 years agoAssert that the mbuf in the chain has sane length. Proper place for
Konstantin Belousov [Fri, 1 Feb 2013 16:57:02 +0000 (16:57 +0000)]
Assert that the mbuf in the chain has sane length.  Proper place for
this check is somewhere in the network code, but this assertion
already proven to be useful in catching what seems to be driver bugs
causing NFS scrambling random memory.

Discussed with: rmacklem
MFC after: 1 week

11 years agoThe change to reduce default smp_tsc_shift caused tsc shift to become
Konstantin Belousov [Fri, 1 Feb 2013 16:48:55 +0000 (16:48 +0000)]
The change to reduce default smp_tsc_shift caused tsc shift to become
zero on slower machines, which make the fenced get_timecount methods
not used despite needed.  Remove the (shift > 0) condition when
selecting the get_timecount() implementation.

Rename smp_tsc_shift to tsc_shift, and apply it for the UP case too.
Allow shift to reach value of 31 instead of 30, as it was previously
(should be nop).

Reorganize the tc quality calculation to remove the conditionally
compiled block.  Rename test_smp_tsc() to test_tsc() and provide
separate versions for SMP and UP builds.  The check for virtialized
hardware is more natural to perform in the smp version of the
test_tsc(), since it is only done for smp case.

Noted and reviewed by: bde (previous version)
MFC after: 12 days

11 years agoAdd placeholder constants to reserve a portion of the socket option
John Baldwin [Fri, 1 Feb 2013 15:32:20 +0000 (15:32 +0000)]
Add placeholder constants to reserve a portion of the socket option
name space for use by downstream vendors to add custom options.

MFC after: 2 weeks

11 years agoChange old-style function definition
Philippe Charnier [Fri, 1 Feb 2013 14:26:54 +0000 (14:26 +0000)]
Change old-style function definition

11 years agouma_zone_set_max() directly returns the rounded effective zone
Andre Oppermann [Fri, 1 Feb 2013 14:21:09 +0000 (14:21 +0000)]
uma_zone_set_max() directly returns the rounded effective zone
limit.  Use the return value directly instead of doing a second
uma_zone_set_max() step.

MFC after: 1 week

11 years agoRemove unused VM_MAX_AUTOTUNE_NMBCLUSTERS define.
Andre Oppermann [Fri, 1 Feb 2013 14:16:37 +0000 (14:16 +0000)]
Remove unused VM_MAX_AUTOTUNE_NMBCLUSTERS define.

11 years ago- Fix more style(9)-related issues (copyright header, spaces after function
Pietro Cerutti [Fri, 1 Feb 2013 13:04:06 +0000 (13:04 +0000)]
- Fix more style(9)-related issues (copyright header, spaces after function
  names, unnecessary casts)
- Change type of boolean variable from char to bool

Suggested by: jhb, zont, jmallett
Reviewed by: cognet
Approved by: cognet