]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoxen: fix incorrectly accounted free
royger [Fri, 22 Aug 2014 15:38:21 +0000 (15:38 +0000)]
xen: fix incorrectly accounted free

Fix some frees incorrectly assigned to M_XENBUS when the memory is
allocated with M_XENSTORE.

Sponsored by: Citrix Systems R&D
MFC after: 1 week

dev/xen/blkback/blkback.c:
 - Fix incorrect frees.

9 years agovt(4): The offset to center the text area is per-window now
dumbbell [Fri, 22 Aug 2014 15:36:57 +0000 (15:36 +0000)]
vt(4): The offset to center the text area is per-window now

The previous global offset, based on the last loaded font, had no
meaning for other windows. This caused a shifted text area, often partly
out-of-screen.

MFC after: 1 week

9 years agonetback: remove dead code
royger [Fri, 22 Aug 2014 15:34:56 +0000 (15:34 +0000)]
netback: remove dead code

Remove the xen_net_read_mac function since it's not used anymore.

Sponsored by: Citrix Systems R&D

9 years agovt(4): Give the window to vd_bitblt_text_t callback
dumbbell [Fri, 22 Aug 2014 15:16:41 +0000 (15:16 +0000)]
vt(4): Give the window to vd_bitblt_text_t callback

... instead of both the buffer and the font. Again, this simplifies the
API.

MFC after: 1 week

9 years agonetback: fixes for netback
royger [Fri, 22 Aug 2014 15:10:26 +0000 (15:10 +0000)]
netback: fixes for netback

This patch contains the following fixes for netback:
 - Only unbind the evtchn if it has been bound.
 - Set xnb->bridge to NULL after free to prevent double-freeing it.
 - Set the MAC address for the host-facing interface to a dummy value.

Sponsored by: Citrix Systems R&D

dev/xen/netback/netback.c:
 - Prevent trying to unbind if the evtchn has not been bounded.
 - Prevent double-freeing xnb->bridge.
 - Set the MAC address of the host-facing interface to a dummy value,
   so it can work when the interface is added to a bridge.

9 years agopci: add a new pci_child_added newbus method.
royger [Fri, 22 Aug 2014 15:05:51 +0000 (15:05 +0000)]
pci: add a new pci_child_added newbus method.

This is needed so when running under Xen the calls to pci_child_added
can be intercepted and a custom Xen method can be used to register
those devices with Xen. This should not include any functional
change, since the Xen implementation will be added in a following
patch and the native implementation is a noop.

Sponsored by: Citrix Systems R&D
Reviewed by: jhb

dev/pci/pci.c:
dev/pci/pci_if.m:
dev/pci/pci_private.h:
dev/pci/pcivar.h:
 - Add the pci_child_added newbus method.

9 years agovt(4): Store cursor bitmap & colors in struct vt_device
dumbbell [Fri, 22 Aug 2014 14:31:53 +0000 (14:31 +0000)]
vt(4): Store cursor bitmap & colors in struct vt_device

This removes the need to specify them to each call to vd_bitblt_text_t
and, therefore, simplifies the API.

MFC after: 1 week

9 years agovt(4): Mark new mouse position as dirty only when it's actually displayed
dumbbell [Fri, 22 Aug 2014 13:48:33 +0000 (13:48 +0000)]
vt(4): Mark new mouse position as dirty only when it's actually displayed

MFC after: 1 week

9 years agoWe should never enter the PROBE_SETAN phase if we're not ATAPI, since
imp [Fri, 22 Aug 2014 13:15:59 +0000 (13:15 +0000)]
We should never enter the PROBE_SETAN phase if we're not ATAPI, since
that's ATAPI specific. Instead, skip to PROBE_SET_MULTI instead for
non ATAPI protocols. The prior code incorrectly terminated the probe
with a break, rather than arranging for probedone to get called. This
caused panics or worse on some systems.

9 years agoFix a recursive lock acquisition in vi_reset_dev().
tychon [Fri, 22 Aug 2014 13:01:22 +0000 (13:01 +0000)]
Fix a recursive lock acquisition in vi_reset_dev().

Reviewed by: grehan

9 years agovt_vga: Clip the draw area to never draw offscreen
dumbbell [Fri, 22 Aug 2014 10:49:51 +0000 (10:49 +0000)]
vt_vga: Clip the draw area to never draw offscreen

This fixes a bug when two windows use different fonts, but a longer-term
solution is required. The dirty area should be stored as pixels, not
character cells, because such coordinates don't have the same meaning in
all windows, when using different fonts.

MFC after: 1 week

9 years agovt(4): Add new vd_bitblt_text_t callback, and implement it for vt_vga
dumbbell [Fri, 22 Aug 2014 08:22:40 +0000 (08:22 +0000)]
vt(4): Add new vd_bitblt_text_t callback, and implement it for vt_vga

Compared to the deprecated vd_bitbltchr_t callback, vd_bitblt_text_t
receives:
    o  the whole text buffer
    o  the dirty area
    o  the mouse cursor (map, position, colors)

This allows the backend to perform optimization on how to draw things.
The goal is to remove vd_bitbltchr_t and vd_putchar_t, once all driver
are converted (only vt_vga is included in this commit).

In vt_vga, this allows to draw the text and the cursor in one pass,
without ever reading from video memory (because it has all the context).
The main benefit is the speed improvement: no more slideshow during
boot!

Other bugs fixed in vt_vga are:
    o  left-most characters are drawn properly (the left-most pixels were
       missing with bold characters and some wide letters such as 'm')
    o  no more black square around the cursor
    o  no cursor flickering when the text is scrolling

There are still many problems to fix: the known issues are marked with
"FIXME" inside the code.

MFC after: 1 week

9 years agoEnsure that sigaction flags for signal, which disposition is reset to
kib [Fri, 22 Aug 2014 08:19:08 +0000 (08:19 +0000)]
Ensure that sigaction flags for signal, which disposition is reset to
ignored or default, are not leaking.  Apparently, there exists code
which relies on SA_SIGINFO not reported for SIG_DFL or SIG_IGN.

In kern_sigaction, ignore flags when resetting.  Encapsulate the flag
and disposition testing into helper sigact_flag_test().

On exec, and when delivering signal with SA_RESETHAND flag set,
signals are reset automatically.  Use new helper sigdflt(), which
removes duplicated code and corrects all flag bits for the signal.

For proc0, set sigintr bit for all ignored signals.  Ignored signals
are consumed in tdsendsignal() and not delivered to the victim thread
at all.

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

9 years agoCheck the validity of struct sigaction sa_flags value, reject unknown
kib [Fri, 22 Aug 2014 07:52:47 +0000 (07:52 +0000)]
Check the validity of struct sigaction sa_flags value, reject unknown
flags.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoFix a panic which occurs in a VIMAGE-enabled kernel after r270158, and
hrs [Fri, 22 Aug 2014 05:03:30 +0000 (05:03 +0000)]
Fix a panic which occurs in a VIMAGE-enabled kernel after r270158, and
separate socket_hhook_register() part and put it into VNET_SYS{,UN}INIT()
handler.

Discussed with: marcel

9 years agoFix powerpc build:
delphij [Fri, 22 Aug 2014 01:23:38 +0000 (01:23 +0000)]
Fix powerpc build:

Chase r270227 and compile lockstat with C99 standard.

Suggested by: bde

9 years agoInclude two headers to provide prototype for modfind(2) and kldload(2).
delphij [Thu, 21 Aug 2014 22:53:14 +0000 (22:53 +0000)]
Include two headers to provide prototype for modfind(2) and kldload(2).

MFC after: 2 weeks

9 years agoThis module requires pci_if.h, add it to the SRCS list.
ian [Thu, 21 Aug 2014 22:42:02 +0000 (22:42 +0000)]
This module requires pci_if.h, add it to the SRCS list.

We haven't noticed that it was missing because eisa has been disabled for
a while in -current, but it became apparent when some parallel-build stuff
was MFC'd to 10-stable and this module failed to build there.

9 years agoAdd the Samsung 843T as a 4k enabled drive
sbruno [Thu, 21 Aug 2014 21:05:58 +0000 (21:05 +0000)]
Add the Samsung 843T as a 4k enabled drive

Submitted by: Jason Wolfe <jason@llnw.com>
MFC after: 2 weeks
Sponsored by: Limelight Networks

9 years agoelfdump: Remove extraneous _SUNW_ in reported DT_ names
emaste [Thu, 21 Aug 2014 20:58:43 +0000 (20:58 +0000)]
elfdump: Remove extraneous _SUNW_ in reported DT_ names

Sponsored by: The FreeBSD Foundation

9 years agoRename DT_FEATURE_1 to DT_FEATURE
emaste [Thu, 21 Aug 2014 20:55:10 +0000 (20:55 +0000)]
Rename DT_FEATURE_1 to DT_FEATURE

This provides a minor cleanup in elfdump; there are otherwise no
consumers in the tree.  Old SUN documentation can be found for either
variant, but GNU binutils switched to DT_FEATURE around 2000.

Sponsored by: The FreeBSD Foundation

9 years agoModify a few output file names as used with vt.
se [Thu, 21 Aug 2014 20:35:39 +0000 (20:35 +0000)]
Modify a few output file names as used with vt.

MFC after: 3 days

9 years agoNext round of fixes.
se [Thu, 21 Aug 2014 20:33:09 +0000 (20:33 +0000)]
Next round of fixes.

MFC after: 3 days

9 years agovt_vga: When clearing video memory, don't read from it
dumbbell [Thu, 21 Aug 2014 20:10:05 +0000 (20:10 +0000)]
vt_vga: When clearing video memory, don't read from it

The goal is to clear the video memory, in case an application drew to
it. So the content shouldn't be loaded in the latches, it can't be
trusted anyway.

This improves a bit the window switch speed.

MFC after: 1 week

9 years agovt(4): Rename the "mouse_cursor" structure to "vt_mouse_cursor"
dumbbell [Thu, 21 Aug 2014 19:42:24 +0000 (19:42 +0000)]
vt(4): Rename the "mouse_cursor" structure to "vt_mouse_cursor"

At the same time, "w" and "h" members are now called "width" and
"height". The goal is to have a more "public" structure, because it will
soon be passed as argument to a new callback, replacing vd_bitbltchr_t.

MFC after: 1 week

9 years agovt(4): Test if the cursor is shown only once
dumbbell [Thu, 21 Aug 2014 19:15:22 +0000 (19:15 +0000)]
vt(4): Test if the cursor is shown only once

Later, we just see if the "struct mouse_cursor" pointer is set. This
avoids the need to mess with all the conditions several times; this has
been error prone.

While here, rename the variable "m" to a more meaningful "cursor", like
it's done elsewhere in the code.

MFC after: 1 week

9 years agoChange file permissions for some setuid executables so they are "o+r".
neel [Thu, 21 Aug 2014 19:04:15 +0000 (19:04 +0000)]
Change file permissions for some setuid executables so they are "o+r".
The executable itself doesn't contain any privileged information.

An example of where this is useful is when makefs(8) is creating an image
that includes /sbin/shutdown. This can now be done without root privileges.

Reviewed by: delphij
Discussed with: delphij, des
CR: https://reviews.freebsd.org/D662

9 years agovt(4): Constify vt_buf argument of vtbuf_iscursor()
dumbbell [Thu, 21 Aug 2014 18:26:32 +0000 (18:26 +0000)]
vt(4): Constify vt_buf argument of vtbuf_iscursor()

MFC after: 1 week

9 years ago* Add new net/sff8436.h containing constants used to access
melifaro [Thu, 21 Aug 2014 17:54:42 +0000 (17:54 +0000)]
* Add new net/sff8436.h containing constants used to access
  QSFP+ data via i2c inteface. These constants has been taken
  from SFF-8436 "QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER" standard
  rev 4.8.
* Add support for printing QSFP+ information from 40G NICs
  such as Chelsio T5.

This commit does not contain ioctl changes necessary for this
functionality work, there will be another commit soon.

Example:
cxl1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=ec07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,.....>
        ether 00:07:43:28:ad:08
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet 40Gbase-LR4 <full-duplex>
        status: active
        plugged: QSFP+ 40GBASE-LR4 (MPO Parallel Optic)
        vendor: OEM PN: OP-QSFP-40G-LR4 SN: 20140318001 DATE: 2014-03-18
        module temperature: 64.06 C voltage: 3.26 Volts
        lane 1: RX: 0.47 mW (-3.21 dBm) TX: 2.78 mW (4.46 dBm)
        lane 2: RX: 0.20 mW (-6.94 dBm) TX: 2.80 mW (4.47 dBm)
        lane 3: RX: 0.18 mW (-7.38 dBm) TX: 2.79 mW (4.47 dBm)
        lane 4: RX: 0.90 mW (-0.45 dBm) TX: 2.80 mW (4.48 dBm)

Tested on: Chelsio T5
Tested on: Mellanox/Huawei passive/active cables/transceivers.
MFC after: 2 weeks
Sponsored by: Yandex LLC

9 years agoAdd `-A' flag to pkg-install(8) invocation when installing dependencies.
dteske [Thu, 21 Aug 2014 17:15:09 +0000 (17:15 +0000)]
Add `-A' flag to pkg-install(8) invocation when installing dependencies.

MFC after: 3 days
X-MFC-to: stable/10, stable/9
Reported by: gjb
Discussed with: jelischer, gjb, bdrewery

9 years agoUse proper include paths in kernel iSCSI code.
trasz [Thu, 21 Aug 2014 16:08:17 +0000 (16:08 +0000)]
Use proper include paths in kernel iSCSI code.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoFix includes.
trasz [Thu, 21 Aug 2014 15:59:25 +0000 (15:59 +0000)]
Fix includes.

Suggested by: pluknet@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agovt(4): Pause the flush timer while swithing window
dumbbell [Thu, 21 Aug 2014 15:55:18 +0000 (15:55 +0000)]
vt(4): Pause the flush timer while swithing window

This fixes bad looking refresh when switching window: squares instead
of text, flashing screen, and so on. In the worst case, vt_flush() came
at a very inappropriate timing and the screen was not refreshed at all
(leaving squares all over the place).

This doesn't fix the flickering of the screen with vt_vga, because the
sync signal is temporarily stopped and the video memory is cleared.

MFC after: 1 week

9 years agoMake the iSCSI stack use __FBSDID() properly.
trasz [Thu, 21 Aug 2014 15:32:38 +0000 (15:32 +0000)]
Make the iSCSI stack use __FBSDID() properly.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agovt(4): Mark cursor position as dirty when we enable/disable it
dumbbell [Thu, 21 Aug 2014 15:14:54 +0000 (15:14 +0000)]
vt(4): Mark cursor position as dirty when we enable/disable it

MFC after: 1 week

9 years agoAdd guards to ptrdiff_t definition in include/stddef.h
kan [Thu, 21 Aug 2014 15:10:10 +0000 (15:10 +0000)]
Add guards to ptrdiff_t definition in include/stddef.h

Back in 2011 obrien has added the #define macro in sys/sys/stddef.h to
guard ptrdiff_t. Add similar protection to the identical code in
include/stddef.h.

Submitted by:   Mariusz Zaborski <oshogbo@FreeBSD.org>
MFC after:      1 week

9 years agoUse __FBSDID() properly.
trasz [Thu, 21 Aug 2014 15:07:25 +0000 (15:07 +0000)]
Use __FBSDID() properly.

Suggested by: pluknet@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agovt(4): Mark the current cursor position as dirty
dumbbell [Thu, 21 Aug 2014 15:00:21 +0000 (15:00 +0000)]
vt(4): Mark the current cursor position as dirty

Like r270273, this has no effect for now, because the cursor is always
drawn. This is in preparation of future changes to vd_bitbltchr_t API.

MFC after: 1 week

9 years agovt(4): If the cursor didn't move, don't mark its position as dirty
dumbbell [Thu, 21 Aug 2014 14:54:37 +0000 (14:54 +0000)]
vt(4): If the cursor didn't move, don't mark its position as dirty

Currently, this has no effect, because the cursor is always redrawn
anyway. But this will be useful after improvements to the vd_bitbltchr_t
callback API.

The vt_device structure members used to store the position of the cursor
as of the last redraw are renamed from vd_mdirty{x,y} to vd_mold{x,y}.
The associated comment is fixed too. Also, their value is now expressed
in pixels, not in character columns/row.

MFC after: 1 week

9 years agovt(4): If the cursor is globally disabled, don't mark its position as dirty
dumbbell [Thu, 21 Aug 2014 14:12:11 +0000 (14:12 +0000)]
vt(4): If the cursor is globally disabled, don't mark its position as dirty

This avoids unnecessary redraw. In particular, during boot, where the
cursor is disabled and its fake position is [0;0], this triggered a
refresh of the whole screen each time vt_flush() is called.

MFC after: 1 week

9 years agovt(4): Mark cursor old position as dirty before reading the dirty area
dumbbell [Thu, 21 Aug 2014 13:28:48 +0000 (13:28 +0000)]
vt(4): Mark cursor old position as dirty before reading the dirty area

Otherwise, the redraw is done during the next vt_flush run.

MFC after: 1 week

9 years agovt(4): Handle global and per-window mouse cursor toggle in one place
dumbbell [Thu, 21 Aug 2014 13:04:34 +0000 (13:04 +0000)]
vt(4): Handle global and per-window mouse cursor toggle in one place

Before the global flag was set/unset using the CONS_MOUSECTL ioctl, and
the per-window flag through the MOUSE_SETLEVEL or MOUSE_SETMODE ioctls.

Also, if the cursor is already enabled/disabled, return immediatly. This
avoids to reset the cursor's position to the center of the screen.

This matches syscons' behavior.

While here, remove a trailing space and a redundant variable
declaration.

9 years agoDocument MAC address selection and setting for atse(4).
bz [Thu, 21 Aug 2014 12:50:11 +0000 (12:50 +0000)]
Document MAC address selection and setting for atse(4).

Submitted by: brooks
MFC after: 3 days
Sponsored by: DARPA/AFRL

9 years agovt(4): Fix an inconsistency between the mouse cursor bitmap and its mask
dumbbell [Thu, 21 Aug 2014 10:54:39 +0000 (10:54 +0000)]
vt(4): Fix an inconsistency between the mouse cursor bitmap and its mask

MFC after: 1 week

9 years agoRevert r270227. GCC doesn't like the lack of LL suffix,
davide [Thu, 21 Aug 2014 09:01:42 +0000 (09:01 +0000)]
Revert r270227. GCC doesn't like the lack of LL suffix,
so this makes powerpc build failing.

9 years agoProvide compatibility shim for atomic_dec_64_nv.
delphij [Thu, 21 Aug 2014 08:25:46 +0000 (08:25 +0000)]
Provide compatibility shim for atomic_dec_64_nv.

X-MFC-with: r270247
MFC after: 13 days

9 years agoAdd a missing brace to callout_init_rm() to fix syntax.
gavin [Thu, 21 Aug 2014 07:52:51 +0000 (07:52 +0000)]
Add a missing brace to callout_init_rm() to fix syntax.

MFC after: 1 week

9 years agoAlways check the limits of array index variables before using them.
pfg [Thu, 21 Aug 2014 02:40:33 +0000 (02:40 +0000)]
Always check the limits of array index variables before using them.

Obtained from: DragonFlyBSD
MFC after: 1 week

9 years agoAdd missing locking.
adrian [Thu, 21 Aug 2014 00:57:32 +0000 (00:57 +0000)]
Add missing locking.

Whilst here, assert that the lock is held when calling epstop().

Tested:

ep0: <3com Megahertz 574B>

9 years agoChange netmap's global lock to sx instead of a mutex.
np [Wed, 20 Aug 2014 23:37:44 +0000 (23:37 +0000)]
Change netmap's global lock to sx instead of a mutex.

Reviewed by: luigi@
MFC after: 1 day

9 years agoFix return type of callout_init_rm() and add return type to
gavin [Wed, 20 Aug 2014 23:29:34 +0000 (23:29 +0000)]
Fix return type of callout_init_rm() and add return type to
callout_deactivate().

PR: 192520
Submitted by: yaneurabeya gmail com
MFC after: 3 days

9 years agoTurns out that IDENTIFY DEVICE and IDENTIFY PACKET DEVICE return data
imp [Wed, 20 Aug 2014 22:58:12 +0000 (22:58 +0000)]
Turns out that IDENTIFY DEVICE and IDENTIFY PACKET DEVICE return data
that's only mostly similar. Specifically word 78 bits are defined for
IDENTIFY DEVICE as
5 Supports Hardware Feature Control
while a IDENTIFY PACKET DEVICE defines them as
5 Asynchronous notification supported
Therefore, only pay attention to bit 5 when we're talking to ATAPI
devices (we don't use the hardware feature control at this time).
Ignore it for ATA devices. Remove kludge that papered over this issue
for Samsung SATA SSDs, since Micron drives also have the bit set and
the error was caused by this bad interpretation of the spec (which is
quite easy to do, since bits aren't normally overlapping like this).

9 years agoMFV r270196:
delphij [Wed, 20 Aug 2014 22:39:26 +0000 (22:39 +0000)]
MFV r270196:

Illumos issue:
    5047 don't use atomic_*_nv if you discard the return value

MFC after: 2 weeks

9 years agoMFC r270195:
delphij [Wed, 20 Aug 2014 21:44:48 +0000 (21:44 +0000)]
MFC r270195:

Illumos issue:
    5045 use atomic_{inc,dec}_* instead of atomic_add_*

MFC after: 2 weeks

9 years agosh: Remove two redundant (uintmax_t) casts.
jilles [Wed, 20 Aug 2014 20:15:43 +0000 (20:15 +0000)]
sh: Remove two redundant (uintmax_t) casts.

Submitted by: jmallett

9 years agoMFV r270193:
delphij [Wed, 20 Aug 2014 18:29:18 +0000 (18:29 +0000)]
MFV r270193:

Illumos issues:
    5042 stop using deprecated atomic functions

MFC after: 2 weeks

9 years agoRecover sin6_scope_id of gateway addresses in riprecv() by using the if_index
hrs [Wed, 20 Aug 2014 17:27:15 +0000 (17:27 +0000)]
Recover sin6_scope_id of gateway addresses in riprecv() by using the if_index
where a RIP packet was received.  This fixes a bug which prevented gateway
addresses in fe80::/64 from being added.

9 years agoThe conversion tools have been further improved and some erroneous
se [Wed, 20 Aug 2014 17:07:41 +0000 (17:07 +0000)]
The conversion tools have been further improved and some erroneous
conversions have been detected and fixed.

It is now possible to add options after the encoding in the parameter
list for convert-keymap.pl. This is currently used to selectively
enable interpretation of the ISO8859-1 currency symbol as the Euro
sign found in ISO5589-15, or to add a Yen symbol in place of '\' for
specific Japanese keyboards. The option are appended to the parameter
list, as in e.g. "convert-keymap.pl german.iso.kbd ISO5589-1 EURO".

The options are appended to the encoding in the form "+EURO" or "+YEN"
in KBDFILES.map, to keep the meaning of the columns intact.

MFC after: 3 days

9 years agoMisc fixes suggested by Coverity.
asomers [Wed, 20 Aug 2014 17:04:49 +0000 (17:04 +0000)]
Misc fixes suggested by Coverity.

sbin/devd/tests/client_test.c
* In the event that popen fails, don't dereference its return value.
* Fix array overwrite in the stream and seqpacket tests.
* Close sockets at the end of successful ATF tests.

Reported by: Coverity scan
CID: 1232019123202012320291232030
MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoRewrite of ti_i2c based on gonzo's patch, fix the following bugs/problems:
loos [Wed, 20 Aug 2014 17:02:37 +0000 (17:02 +0000)]
Rewrite of ti_i2c based on gonzo's patch, fix the following bugs/problems:

  . interrupt storm detected on "intr70:"; throttling interrupt source;

  . Added access serialization on iicbus_transfer(), previously there was
    no such protection and a new transfer could easily confuse the
    controller;

  . Add error checkings (i.e. stop the transfer when a error is detected
    and do _not_ overwrite the previous error);

  . On command done interrupt do not assume that the transfer was finished
    sucessfully as we will receive the command done interrupt even after
    errors;

  . Simplify the FIFO handling;

  . Reset the FIFO between the transfers as the FIFO may contain data from
    the last (failed) transfer;

  . Fix the iicbus speed for AM335x, which in turn will make better use of
    the I2C noise filter (set to one internal clock cycle);

  . Move the read and write handler to ithread instead of notifying the
    requesting thread with wakeup(9);

  . Fix the comments based on OMAP4 TRM.

The above changes allows me to read the EDID from my HDMI monitor on BBB
with gonzo's patches to support TDA19988 (which does 128 bytes reads) and
repeatedly scan the iicbus (with a modified i2c(8)) without lock up the bus.

Phabric: D465

9 years agoAnother rpund of fixes, after checking keymaps for plausibility and with
se [Wed, 20 Aug 2014 17:00:47 +0000 (17:00 +0000)]
Another rpund of fixes, after checking keymaps for plausibility and with
several updates to the converter tools. There is now support for hybrid
source keymaps, which e.g. use ISO8859-1 (not -15) but still provide an
Euro key (on the "E" key). ISO8859-1 currency symbols on other keys are
still converted to that character, not the Euro sign. A similar hack was
applied to the Japanese keyboards to add the Yen key, that could not be
expressed in SYSCONS.

Several modifications have been applied after the conversion (removal of
unused accents tables, some reformatting, exchange of a few key symbols).

The German keymap (de.kbd) is now using deadkeys only for those keys,
that behave that way under Windows. There are now ".acc" and ".noacc"
variants, which use deadkeys vs. nodeadkeys for all accent keys.

I'm still in the process of comparing keymaps that existed in different
encodings in SYSCONS. These are generally translated slightly differently,
either because of mistakes, or because of different preferences, or due
to limitations of the respective encoding.

MFC after: 3 days

9 years agoNumerous small fixes, mostly suggested by Coverity.
asomers [Wed, 20 Aug 2014 16:59:33 +0000 (16:59 +0000)]
Numerous small fixes, mostly suggested by Coverity.

tests/sys/kern/unix_seqpacket_test.c
* Remove a duplicate error check in mk_pair_of_sockets
* Always close sockets in the success path of ATF test cases.  Don't
  bother with the error paths, because those are mostly assertions
  anyway.  Most of these socket leaks were reported by Coverity.
  All of them are harmless, because each ATF test case runs in its
  own process.
* Fix the len argument to send in shutdown_send and
  shutdown_send_sigpipe.  The old version was using sizeof a pointer
  instead of sizeof the char array.  Reported by Coverity.
* Change a few ATF_CHECK to ATF_REQUIRE if the test can't reasonably
  continue past a failure.

Reported by: Coverity Scan
CID: 122999512299911229988122999412299891229992
CID: 122999312299901229984122996712300051229977
CID: 122996612300041229976
MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoMake Bruce happy removing the "LL abomination" from time.h
davide [Wed, 20 Aug 2014 16:32:02 +0000 (16:32 +0000)]
Make Bruce happy removing the "LL abomination" from time.h
It's not necessary in all the three instances because
they already have the correct type on all the supported
arches.

Requested by: bde

9 years agoAdd kernel modules for si(4), wds(4), and wl(4).
jhb [Wed, 20 Aug 2014 16:09:05 +0000 (16:09 +0000)]
Add kernel modules for si(4), wds(4), and wl(4).

9 years agoUnexpand TAILQ_FOREACH().
jhb [Wed, 20 Aug 2014 16:07:56 +0000 (16:07 +0000)]
Unexpand TAILQ_FOREACH().

9 years agoFix build of si(4) and enable it in LINT on amd64 and i386.
jhb [Wed, 20 Aug 2014 16:07:17 +0000 (16:07 +0000)]
Fix build of si(4) and enable it in LINT on amd64 and i386.

9 years agoBump MAXCPU on amd64 from 64 to 256. In practice APIC only permits 255
jhb [Wed, 20 Aug 2014 16:06:24 +0000 (16:06 +0000)]
Bump MAXCPU on amd64 from 64 to 256.  In practice APIC only permits 255
CPUs (IDs 0 through 254).  Getting above that limit requires x2APIC.

MFC after: 1 month

9 years agoBump the default size of cpuset_t masks in userland from 128 bits to 256.
jhb [Wed, 20 Aug 2014 16:05:15 +0000 (16:05 +0000)]
Bump the default size of cpuset_t masks in userland from 128 bits to 256.

This should not be an ABI change since the various public APIs that use
cpusets all include an explicit size parameter in addition to the cpuset
parameter.

MFC after: 1 week

9 years agoReplace dev_clone with cdevpriv(9) KPI in audit_pipe code.
davide [Wed, 20 Aug 2014 16:04:30 +0000 (16:04 +0000)]
Replace dev_clone with cdevpriv(9) KPI in audit_pipe code.
This is (yet another) step towards the removal of device
cloning from our kernel.

CR: https://reviews.freebsd.org/D441
Reviewed by: kib, rwatson
Tested by: pho

9 years agoAdd ${LIBC} to DPADD to fix "make checkdpadd"
ngie [Wed, 20 Aug 2014 15:43:26 +0000 (15:43 +0000)]
Add ${LIBC} to DPADD to fix "make checkdpadd"

Phabric: D632
Approved by: jmmv (mentor)
MFC after: 2 weeks

9 years agoAdd missing break.
pfg [Wed, 20 Aug 2014 14:58:25 +0000 (14:58 +0000)]
Add missing break.

CID: 603368

9 years agopci: make MSI(-X) enable and disable methods of the PCI bus
royger [Wed, 20 Aug 2014 14:57:20 +0000 (14:57 +0000)]
pci: make MSI(-X) enable and disable methods of the PCI bus

Make the functions pci_disable_msi, pci_enable_msi and pci_enable_msix
methods of the newbus PCI bus. This code should not include any
functional change.

Sponsored by: Citrix Systems R&D
Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D354

dev/pci/pci.c:
 - Convert the mentioned functions to newbus methods.
 - Fix the callers of the converted functions.

sys/dev/pci/pci_private.h:
dev/pci/pci_if.m:
 - Declare the new methods.

dev/pci/pcivar.h:
 - Add helpers to call the newbus methods.

ofed/include/linux/pci.h:
 - Add define to prevent the ofed version of pci_enable_msix from
   clashing with the FreeBSD native version.

9 years agoRemove useless - and buggy, it resulted in spurious warnings in logs - code.
trasz [Wed, 20 Aug 2014 13:54:27 +0000 (13:54 +0000)]
Remove useless - and buggy, it resulted in spurious warnings in logs - code.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoAdd description for the "automounted" mount flag.
trasz [Wed, 20 Aug 2014 13:52:47 +0000 (13:52 +0000)]
Add description for the "automounted" mount flag.

Reviewed by: emaste@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoRework ".." lookup; previous one failed to properly busy the mountpoint.
trasz [Wed, 20 Aug 2014 13:46:51 +0000 (13:46 +0000)]
Rework ".." lookup; previous one failed to properly busy the mountpoint.

Reviewed by: kib@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoAfter much toying around with this AMRR initial rate stuff,
adrian [Wed, 20 Aug 2014 09:10:03 +0000 (09:10 +0000)]
After much toying around with this AMRR initial rate stuff,
I've decided that for 11n rates it's best to start (very) low and work
our way up.

So, from now on, the initial rate for AMRR 11n is MCS4.
It doesn't try MCS12 or MCS20 - at low signal strengths those don't
work very well at all.

AMRR will step the rate control up over time if things work out better.

Tested:

* Intel 5100
* Intel 5300 (using local diffs to test out 3x3 stream support)

9 years agoDo not busy the UFS mount point inside VOP_RENAME(). The
kib [Wed, 20 Aug 2014 08:15:23 +0000 (08:15 +0000)]
Do not busy the UFS mount point inside VOP_RENAME().  The
kern_renameat() already starts write on the mp, which prevents
parallel unmount from proceed.  Busying mp after vn_start_write()
deadlocks the unmount.

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

9 years agoCorrect the test for condition to suspend UFS filesystem during
kib [Wed, 20 Aug 2014 08:13:03 +0000 (08:13 +0000)]
Correct the test for condition to suspend UFS filesystem during
unmount.  There is no need to suspend read-only filesystem, while we
need suspension on modificable mount point.

Reported by: rwatson
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoIncrease max number of physical segments on amd64 to 63.
kib [Wed, 20 Aug 2014 08:07:08 +0000 (08:07 +0000)]
Increase max number of physical segments on amd64 to 63.

Eventually, the vmd_segs of the struct vm_domain should become bitset
instead of long, to allow arbitrary compile-time selected maximum.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoAdd arch-specific macro SFBUF_PHYS_DMAP(), which should translate the
kib [Wed, 20 Aug 2014 08:02:38 +0000 (08:02 +0000)]
Add arch-specific macro SFBUF_PHYS_DMAP(), which should translate the
physical address of the page to direct map address, in case
SFBUF_OPTIONAL_DIRECT_MAP returns true.  The case of PowerPC AIM
64bit, where the page physical address is identical to the direct map
address, is accidental.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation

9 years agoFix conversion errors leading to malformed keymap files.
se [Wed, 20 Aug 2014 07:48:09 +0000 (07:48 +0000)]
Fix conversion errors leading to malformed keymap files.

MFC after: 3 days

9 years agoFix further conversion errors found while testing the converted keymaps.
se [Wed, 20 Aug 2014 07:46:28 +0000 (07:46 +0000)]
Fix further conversion errors found while testing the converted keymaps.

MFC after: 3 days

9 years agoIf eapol packets are sent at the lowest rate, key negotiation will
kevlo [Wed, 20 Aug 2014 01:32:04 +0000 (01:32 +0000)]
If eapol packets are sent at the lowest rate, key negotiation will
become more reliable.

Submitted by: Akinori Furukoshi <moonlightakkiy at yahoo dot ca>

9 years agoAdd the D-Link DWA-125 rev D1.
kevlo [Wed, 20 Aug 2014 01:26:27 +0000 (01:26 +0000)]
Add the D-Link DWA-125 rev D1.

Tested by myself.

9 years agoDon't stop other legs of a parallel build due to a failure in make_check.
ian [Wed, 20 Aug 2014 00:33:37 +0000 (00:33 +0000)]
Don't stop other legs of a parallel build due to a failure in make_check.
The whole point is to see if there's any failure, which is handled by
building a newer version of make.

9 years agoAdd zdb into rescue environment.
delphij [Wed, 20 Aug 2014 00:14:41 +0000 (00:14 +0000)]
Add zdb into rescue environment.

On amd64, this would increase the binary size by 1.1MiB and
make it possible to examine zpool status offline, useful for
recovery and diagnostic purposes.

Submitted by: sef
Obtained from: FreeNAS
MFC after: 2 weeks

9 years agoAvoid showing stale errors when nmount(2) fails.
bdrewery [Tue, 19 Aug 2014 21:04:31 +0000 (21:04 +0000)]
Avoid showing stale errors when nmount(2) fails.

Sometimes nmount(2) will fail without setting errmsg. The previous (ignored)
error would then be shown as the reason for the failed call if the next
nmount(2) also fails without [ENOENT,ENOTSUP].

An example is when there is a tmpfs mounted with -o size. vfs_filteropt() adds
'size' as an error in errmsg due to 'size' not being in tmpfs_updateopts. Then
tmpfs_mount returns [ENOTSUP] from nmount(2), which is then ignored. The next
call may race with an unmount causing an invalid [EINVAL] that then does log an
error, with the tmpfs errmsg.

The race itself is a separate issue to fix as it is expected to have an
[ENOENT] returned instead.

In this example the mount being shown is actually nullfs, not tmpfs that the
error is from.

  mountd[740]: can't delete exports for /poudriere/data/.m/exp-head-commit-test-devel/04/.npkg: Invalid argument mount option <size> is unknown

It should only show:

  mountd[740]: can't delete exports for /poudriere/data/.m/exp-head-commit-test-devel/04/.npkg: Invalid argument

MFC after: 2 weeks

9 years agoAdd recent DragonFly releases.
bdrewery [Tue, 19 Aug 2014 20:35:09 +0000 (20:35 +0000)]
Add recent DragonFly releases.

Submitted by: Zach Crownover <zachary.crownover@gmail.com>
MFC after: 1 week

9 years agoAdd LIBMD and LIBUTIL to DPADD to fix "make checkdpadd"
ngie [Tue, 19 Aug 2014 18:47:47 +0000 (18:47 +0000)]
Add LIBMD and LIBUTIL to DPADD to fix "make checkdpadd"

Approved by: jmmv (mentor)
MFC after: 5 days
Phabric: D633
PR: 192763

9 years agoAdd missing libraries to DPADD; sort DPADD so DPADD and LDADD match up
ngie [Tue, 19 Aug 2014 18:31:20 +0000 (18:31 +0000)]
Add missing libraries to DPADD; sort DPADD so DPADD and LDADD match up

This fixes "make checkdpadd"

Approved by: jmmv (mentor)
MFC after: 2 weeks
Phabric: D630
PR: 192765

9 years agoFix typo (LIBLDNSADD -> LIBLDNS) to fix "make checkdpadd"
ngie [Tue, 19 Aug 2014 18:27:43 +0000 (18:27 +0000)]
Fix typo (LIBLDNSADD -> LIBLDNS) to fix "make checkdpadd"

X-MFC with: r269648
Phabric: D634
Approved by: jmmv (mentor)

9 years agoFix lock recursion on LUN shutdown, introduced on r269497.
mav [Tue, 19 Aug 2014 17:04:18 +0000 (17:04 +0000)]
Fix lock recursion on LUN shutdown, introduced on r269497.

MFC after: 3 days

9 years agoBump __FreeBSD_version after r269489 so ports can use it.
bdrewery [Tue, 19 Aug 2014 15:47:51 +0000 (15:47 +0000)]
Bump __FreeBSD_version after r269489 so ports can use it.

9 years agoRegen after r270171
bdrewery [Tue, 19 Aug 2014 15:46:40 +0000 (15:46 +0000)]
Regen after r270171

9 years agoAdd missing WITHOUT_CUSE file.
hselasky [Tue, 19 Aug 2014 15:40:26 +0000 (15:40 +0000)]
Add missing WITHOUT_CUSE file.

9 years agoUse bsd.lib.mk here as all other csu Makefiles do.
bdrewery [Tue, 19 Aug 2014 15:30:56 +0000 (15:30 +0000)]
Use bsd.lib.mk here as all other csu Makefiles do.

This effectively reverts r124752.

There's no reason this should be different. It resulted in needing NO_PIE in
the original opt-out NO_PIE commit as this was not using the proper framework.

Reported by: peter

9 years agoRegen after r270168
bdrewery [Tue, 19 Aug 2014 15:09:24 +0000 (15:09 +0000)]
Regen after r270168

9 years agoRevert r267233 for now. PIE support needs to be reworked.
bdrewery [Tue, 19 Aug 2014 15:04:32 +0000 (15:04 +0000)]
Revert r267233 for now. PIE support needs to be reworked.

1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
   build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
   where it never would work anyhow, such as csu or loader. This suggests
   there may be better ways of adding support to the tree. Many of these
   cases can be fixed such that -fPIE will work but there is really no
   reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
   really building libraries but have been using bsd.prog.mk because the code
   is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
   been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by: kib

9 years agoSort ASUS section and add USB device ID of ASUS USB-AC51.
kevlo [Tue, 19 Aug 2014 09:02:58 +0000 (09:02 +0000)]
Sort ASUS section and add USB device ID of ASUS USB-AC51.

9 years agoAdd support for -X, which installs the native cross tools for qemu
imp [Tue, 19 Aug 2014 03:51:10 +0000 (03:51 +0000)]
Add support for -X, which installs the native cross tools for qemu
operations. Doesn't install qemu nor setup the jail, yet.