Commit Graph

91840 Commits

Author SHA1 Message Date
David E. O'Brien
d9a447559b Sync with HEAD. 2013-02-08 16:10:16 +00:00
David E. O'Brien
3cbf5f97aa Correct the r242545 sync with head@242525. 2013-02-07 00:48:42 +00:00
Pawel Jakub Dawidek
fbda3d5dae Audit sockaddr argument for bind(2), connect(2), accept(2), sendto(2) and
recvfrom(2) syscalls.

Sponsored by:	The FreeBSD Foundation
2013-02-07 00:36:00 +00:00
Pawel Jakub Dawidek
82b316b377 Minor style tweaks. 2013-02-07 00:27:11 +00:00
Pawel Jakub Dawidek
222069f454 Add AUDIT_ARG_SOCKADDR() macro so we can start using the audit_arg_sockaddr()
function, which is currently unused.

Sponsored by:	The FreeBSD Foundation
2013-02-07 00:24:23 +00:00
Hans Petter Selasky
76b7121294 Add support for buttons on USB audio devices,
like Volume Up and Volume Down.

Reviewed by:	mav @
MFC after:	1 week
2013-02-06 17:43:05 +00:00
John Baldwin
a120a7a3cd 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
2013-02-06 17:06:51 +00:00
Sergey Kandaurov
23c053d6a2 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
2013-02-06 15:18:46 +00:00
Hans Petter Selasky
68fdacf7c5 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
2013-02-06 11:16:18 +00:00
Gleb Smirnoff
5fb0e927a8 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
2013-02-06 07:27:25 +00:00
Navdeep Parhar
0d8158d796 Busy-wait when cold.
Reported by:	gnn, jhb
MFC after:	3 days
2013-02-06 06:44:42 +00:00
Neel Natu
6d62a48f47 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
2013-02-06 04:53:00 +00:00
Ganbold Tsagaankhuu
0a8038e3d7 Use and set gpio pin to high to power up usb.
Approved by: gonzo@
2013-02-06 01:03:13 +00:00
Sergey Kandaurov
51dc4fea4c Remove reference to the rlist code from comments, and fix a typo visible
in the resulted change.

Reviewed by:	kib
MFC after:	1 week
2013-02-05 20:08:33 +00:00
Andrew Turner
f892543501 * 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.
2013-02-05 20:03:58 +00:00
Hans Petter Selasky
9b3a48ee6f 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.
2013-02-05 14:44:25 +00:00
Hans Petter Selasky
ff182db6c8 Fix some nits. 2013-02-05 13:30:07 +00:00
Hans Petter Selasky
4b037d67aa Fix depend target. 2013-02-05 12:37:50 +00:00
Ganbold Tsagaankhuu
3c9606d74e Remove two dead assignments and
make use of sc more explicit and clear

Submitted by: Christoph Mallon
Approved by: gonzo@
2013-02-05 04:13:34 +00:00
Pedro F. Giffuni
d427334435 ext2fs: move assignment where it is not dead.
Submitted by:	Christoph Mallon
MFC after:	2 weeks
2013-02-05 03:26:34 +00:00
Pedro F. Giffuni
80b6a61199 ext2fs: Remove unused em_e2fsb definition..
Submitted by:	Christoph Mallon
MFC after:	2 weeks
2013-02-05 03:23:56 +00:00
Pedro F. Giffuni
555368dcf1 ext2fs: Remove useless rootino local variable.
Submitted by:	Christoph Mallon
MFC after:	2 weeks
2013-02-05 03:17:41 +00:00
Pedro F. Giffuni
ef024b0da9 ext2fs: Correct off-by-one errors in FFTODT() and DDTOFT().
Submitted by:	Christoph Mallon
MFC after:	2 weeks
2013-02-05 03:13:05 +00:00
Pedro F. Giffuni
666116e4a3 ext2fs: Use nitems().
Submitted by:	Christoph Mallon
MFC after:	2 weeks
2013-02-05 03:08:56 +00:00
Pedro F. Giffuni
fdc100e4c2 ext2fs: Use EXT2_LINK_MAX instead of LINK_MAX
Submitted by:	Christoph Mallon
MFC after:	2 weeks
2013-02-05 03:01:04 +00:00
Ganbold Tsagaankhuu
d9a1428cab Add gpio driver and update dts and kernel config accordingly.
Approved by: gonzo@
2013-02-05 02:25:13 +00:00
Pyun YongHyeon
088dd4b78a 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
2013-02-05 00:37:45 +00:00
Andriy Gapon
c8199bc955 ktr: prevent possible footshooting with KTR_ENTRIES and KTR_BOOT_ENTRIES
Suggested by:	adrian
MFC after:	14 days
X-MFC with:	r246282
2013-02-04 21:58:57 +00:00
Andriy Gapon
f85ed12497 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
2013-02-04 21:50:55 +00:00
Andriy Gapon
30bc1032a9 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
2013-02-04 17:29:13 +00:00
Andrew Turner
b9f7a584fd Use the STACKALIGN macro to alight the stack rather than with a magic mask.
Submitted by:	Christoph Mallon <christoph.mallon gmx.de>
2013-02-04 09:48:50 +00:00
Marius Strobl
94bfd5b1a0 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
2013-02-04 09:35:48 +00:00
Marius Strobl
e8cbe54bc4 Further improve r242655 and supply VM_{MIN,MAX}_KERNEL_ADDRESS as constant
values to SYSCTL_ULONG(9) where possible.

Submitted by:	bde
2013-02-03 21:43:55 +00:00
Marius Strobl
dec2801609 - Make pci_ns8250_ids[] const.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

MFC after:	1 week
2013-02-03 21:30:29 +00:00
Pedro F. Giffuni
be0c475e56 UFS: Remove dead assignment.
Submitted by:	Christoph Mallon
MFC after:	3 days
2013-02-03 21:30:02 +00:00
Andriy Gapon
c7d346f269 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
2013-02-03 18:42:20 +00:00
Kirk McKusick
fe85d98a5b 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
2013-02-03 17:16:32 +00:00
Andriy Gapon
36b7dde416 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
2013-02-03 09:57:39 +00:00
Tim Kientzle
ae6aefaf57 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.
2013-02-03 01:08:01 +00:00
Justin Hibbits
7e7a9efdb5 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
2013-02-03 00:19:34 +00:00
Pedro F. Giffuni
757224cbdb 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
2013-02-02 22:23:45 +00:00
Marius Strobl
ba514351d1 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
2013-02-02 21:57:06 +00:00
Andriy Gapon
8eede5c4d9 fix some fat-fingering in r246246
Submitted by:	mjg
Pointyhat to:	avg
MFC after:	5 days
X-MFC with:	r246246
2013-02-02 14:19:50 +00:00
Andriy Gapon
ebbed20df4 revert accidentally committed unneeded changes from r246250
MFC after:	7 days
X-MFC with:	r246250
2013-02-02 12:52:43 +00:00
Andriy Gapon
b913a7d5d7 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
2013-02-02 12:44:19 +00:00
Andriy Gapon
b1a5c01749 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
2013-02-02 12:42:07 +00:00
Andriy Gapon
1a89ca4cf5 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
2013-02-02 12:04:32 +00:00
Andriy Gapon
548b201607 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
2013-02-02 12:02:42 +00:00
Andriy Gapon
bfdcb3bcba 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
2013-02-02 11:58:35 +00:00
Andriy Gapon
499f60b10b 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
2013-02-02 11:54:00 +00:00