]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoAdd new pmap layer locks to the predefined lock order. Change the names
Alan Cox [Wed, 27 Jun 2012 03:45:25 +0000 (03:45 +0000)]
Add new pmap layer locks to the predefined lock order.  Change the names
of a few existing VM locks to follow a consistent naming scheme.

12 years agoBring over some new typedefs as part of the AR9300 HAL import.
Adrian Chadd [Wed, 27 Jun 2012 03:24:27 +0000 (03:24 +0000)]
Bring over some new typedefs as part of the AR9300 HAL import.

12 years agoRemove duplicate entries.
Adrian Chadd [Wed, 27 Jun 2012 03:00:29 +0000 (03:00 +0000)]
Remove duplicate entries.

12 years agoUse possessive "its", no apostrophe.
Warren Block [Wed, 27 Jun 2012 01:44:48 +0000 (01:44 +0000)]
Use possessive "its", no apostrophe.

MFC after: 1 day

12 years agoTry clean up some of my original text and neaten a table.
Julian Elischer [Wed, 27 Jun 2012 01:13:37 +0000 (01:13 +0000)]
Try clean up some of my original text and neaten a table.

MFC after: 1 week

12 years agoAdd a -I flag which requests confirmation before action, like what is done
Xin LI [Wed, 27 Jun 2012 00:50:25 +0000 (00:50 +0000)]
Add a -I flag which requests confirmation before action, like what is done
in pkill(1).

MFC after: 2 weeks

12 years agoMFV: less v449.
Xin LI [Tue, 26 Jun 2012 23:17:33 +0000 (23:17 +0000)]
MFV: less v449.

12 years agoAdd -DWITH_INSTALL_AS_USER to the source build (naming matches the
David E. O'Brien [Tue, 26 Jun 2012 23:15:55 +0000 (23:15 +0000)]
Add -DWITH_INSTALL_AS_USER to the source build (naming matches the
same functionality of The Ports Collection).
This sets BINOWN, BINGRP, etc... to match current user.  This this
allows 'install', as used in 'make install', to succeed (assuming
user has write permissions).

Submitted by: Simon J Gerraty <sjg@juniper.net>
Discussed on: freebsd-arch

12 years agoBring over the initial 802.11n bluetooth coexistence support code.
Adrian Chadd [Tue, 26 Jun 2012 22:16:53 +0000 (22:16 +0000)]
Bring over the initial 802.11n bluetooth coexistence support code.

The Linux ath9k btcoex code is based off of this code.

Note this doesn't actually implement functional btcoex; there's some
driver glue and a whole lot of verification that is required.

On the other hand, I do have the AR9285+BT and AR9287+BT NICs which
this code supports..

Obtained from: Qualcomm Atheros, Linux ath9k

12 years agoVendor import of less v449 (beta).
Xin LI [Tue, 26 Jun 2012 20:38:53 +0000 (20:38 +0000)]
Vendor import of less v449 (beta).

12 years agoAdd nand core module and module dependency information.
Takanori Watanabe [Tue, 26 Jun 2012 18:08:03 +0000 (18:08 +0000)]
Add nand core module and module dependency information.

Reviewed by:gber

12 years agoIntroduce RELEASE_PV_LIST_LOCK().
Alan Cox [Tue, 26 Jun 2012 16:45:18 +0000 (16:45 +0000)]
Introduce RELEASE_PV_LIST_LOCK().

12 years agoFix an issue that caused the kernel to panic inside CTL when trying
Kenneth D. Merry [Tue, 26 Jun 2012 14:51:35 +0000 (14:51 +0000)]
Fix an issue that caused the kernel to panic inside CTL when trying
to attach to target capable HBAs that implement the old immediate
notify (XPT_IMMED_NOTIFY) and notify acknowledge (XPT_NOTIFY_ACK)
CCBs.  The new API has been in place since SVN change 196008 in
2009.

The solution is two-fold:  fix CTL to handle the responses from the
HBAs, and convert the HBA drivers in question to use the new API.

These drivers have not been tested with CTL, so how well they will
interoperate with CTL is unknown.

scsi_target.c: Update the userland target example code to use the
new immediate notify API.

scsi_ctl.c: Detect when an immediate notify CCB is returned
with CAM_REQ_INVALID or CAM_PROVIDE_FAIL status,
and just free it.

Fix a duplicate assignment.

aic79xx.c,
aic79xx_osm.c: Update the aic79xx driver to use the new API.
Target mode is not enabled on for this driver, so
the changes will have no practical effect.

aic7xxx.c,
aic7xxx_osm.c: Update the aic7xxx driver to use the new API.

sbp_targ.c: Update the firewire target code to work with the
new API.

mpt_cam.c: Update the mpt(4) driver to work with the new API.
Target mode is only enabled for Fibre Channel
mpt(4) devices.

MFC after: 3 days

12 years agoMake sure the BAR TX session pause is correctly unpaused when a node
Adrian Chadd [Tue, 26 Jun 2012 07:56:15 +0000 (07:56 +0000)]
Make sure the BAR TX session pause is correctly unpaused when a node
is reassociating.

PR: kern/169432

12 years agoAdd PV list locking to pmap_enter(). Its execution is no longer serialized
Alan Cox [Tue, 26 Jun 2012 06:02:43 +0000 (06:02 +0000)]
Add PV list locking to pmap_enter().  Its execution is no longer serialized
by the pvh global lock.

Add a needed atomic operation to pmap_object_init_pt().

12 years agoRemove end of line whitespace.
Joel Dahl [Tue, 26 Jun 2012 05:34:31 +0000 (05:34 +0000)]
Remove end of line whitespace.

12 years agoAllow cxgbe(4) running within a VM to attach to its devices that have been
Navdeep Parhar [Tue, 26 Jun 2012 00:34:34 +0000 (00:34 +0000)]
Allow cxgbe(4) running within a VM to attach to its devices that have been
exported via PCI passthrough.

- Do not check for a specific physical function (PF) before claiming a device.
  Different PFs have different device-ids so this check is redundant anyway.

- Obtain the PF# from the WHOAMI register instead of pci_get_function().

- Setup the memory windows using the real BAR0 address, not what the VM says it
  is.

Obtained from: Chelsio Communications

12 years agoExplicitly mention that setting the change and expiry times to zero is
Benjamin Kaduk [Mon, 25 Jun 2012 22:39:37 +0000 (22:39 +0000)]
Explicitly mention that setting the change and expiry times to zero is
equivalent to leaving the time unset. [1]

Wordsmith in the compat support section.

Use a full path to nologin(8) in the context of setting it as a user's shell,
keeping a separate cross-reference.

PR: docs/169354 [1]
Approved by: hrs (mentor)
MFC after: 3 weeks

12 years agoEnsure crunchen uses the same make binary as the rest of the build.
David E. O'Brien [Mon, 25 Jun 2012 21:56:36 +0000 (21:56 +0000)]
Ensure crunchen uses the same make binary as the rest of the build.

Submitted by: Simon Gerraty <sjg@juniper.net>

12 years agoAdd more locale-specific functions to the relevant man pages and
Isabell Long [Mon, 25 Jun 2012 21:51:40 +0000 (21:51 +0000)]
Add more locale-specific functions to the relevant man pages and
Makefiles:
- libc/stdtime/strftime.3
- libc/stdtime/strptime.3
- libc/stdlib/strfmon.3

Reviewed by: theraven
Approved by: gabor (mentor)

12 years agoAdd missing MLINKS for whatever -> if_whatever.
Edward Tomasz Napierala [Mon, 25 Jun 2012 21:33:45 +0000 (21:33 +0000)]
Add missing MLINKS for whatever -> if_whatever.

Reviewed by: brueffer
MFC after: 1 week

12 years agoFix a LOR acquiring the if_afdata lock while holding an rtentry lock.
Xin LI [Mon, 25 Jun 2012 20:56:32 +0000 (20:56 +0000)]
Fix a LOR acquiring the if_afdata lock while holding an rtentry lock.
Possibly do some entra work in case we would not get into the
ifa0 != NULL paths later as we already do for the mltaddr before.

XXX We should possibly error in case in6_setscope fails.

Reference: http://lists.freebsd.org/pipermail/freebsd-net/2011-September/029829.html

Submitted by: bz
MFC after: 1 week

12 years agoUnify sctp_input() and sctp6_input().
Michael Tuexen [Mon, 25 Jun 2012 19:13:43 +0000 (19:13 +0000)]
Unify sctp_input() and sctp6_input().

MFC after: 3 days

12 years agoMFV (r237567):
Xin LI [Mon, 25 Jun 2012 19:01:04 +0000 (19:01 +0000)]
MFV (r237567):

Fetch both ECDSA and RSA keys by default in ssh-keyscan(1).

Approved by: des
Obtained from: OpenSSH portable
MFC after: 1 week

12 years agoMerge from upstream:
Xin LI [Mon, 25 Jun 2012 18:54:02 +0000 (18:54 +0000)]
Merge from upstream:

   - djm@cvs.openbsd.org 2012/04/11 13:34:17
     [ssh-keyscan.1 ssh-keyscan.c]
     now that sshd defaults to offering ECDSA keys, ssh-keyscan should also
     look for them by default; bz#1971

Approved by: des

12 years agoHandle case when result of pmap_pte is NULL. This issue was uncovered
Oleksandr Tymoshenko [Mon, 25 Jun 2012 17:50:11 +0000 (17:50 +0000)]
Handle case when result of pmap_pte is NULL. This issue was uncovered
    by r237367

12 years agoWhitespace cleanup.
Michael Tuexen [Mon, 25 Jun 2012 17:15:09 +0000 (17:15 +0000)]
Whitespace cleanup.

MFC after: 3 days

12 years agoFix clang warning when compiling iw_cxgb.
Navdeep Parhar [Mon, 25 Jun 2012 16:52:27 +0000 (16:52 +0000)]
Fix clang warning when compiling iw_cxgb.

Reported by: rene, dim

12 years agoMesh mode, potential garbage in QoS subfield.
Monthadar Al Jaberi [Mon, 25 Jun 2012 11:52:26 +0000 (11:52 +0000)]
Mesh mode, potential garbage in QoS subfield.

* qos[1] subfield is never assigned a value before this statement.
qos[1] can potentially be OR:ed with garbage. Make it an assignment instead;
* Remove brackets around if statement;

Approved by: adrian

12 years agoFix 'make depend'.
Ulrich Spörlein [Mon, 25 Jun 2012 09:46:06 +0000 (09:46 +0000)]
Fix 'make depend'.

12 years agoAdd PV chunk and list locking to pmap_change_wiring(), pmap_protect(), and
Alan Cox [Mon, 25 Jun 2012 07:13:25 +0000 (07:13 +0000)]
Add PV chunk and list locking to pmap_change_wiring(), pmap_protect(), and
pmap_remove().  The execution of these functions is no longer serialized
by the pvh global lock.

Make some stylistic changes to the affected code for the sake of
consistency with related code elsewhere in the pmap.

12 years agoFix size of the bcopy when extracting ethernet address
Kevin Lo [Mon, 25 Jun 2012 05:47:12 +0000 (05:47 +0000)]
Fix size of the bcopy when extracting ethernet address

Obtained from: DragonFly

12 years agoCorrect sizeof usage
Kevin Lo [Mon, 25 Jun 2012 05:41:16 +0000 (05:41 +0000)]
Correct sizeof usage

Obtained from: DragonFly

12 years agoConsume spare fields for the providergone pointers added to the g_class and
Kenneth D. Merry [Mon, 25 Jun 2012 04:26:10 +0000 (04:26 +0000)]
Consume spare fields for the providergone pointers added to the g_class and
g_geom structures in change 237518.  The original change would have broken
the ABI.

Suggested by: ae
MFC after: 4 days

12 years agoUnbreak register tests for parallel SCSI.
Matt Jacob [Mon, 25 Jun 2012 03:06:29 +0000 (03:06 +0000)]
Unbreak register tests for parallel SCSI.
You can't overwrite registers 7 and 8.
MFC after: 3 days

12 years agoPass the packet length explicitly around.
Michael Tuexen [Sun, 24 Jun 2012 23:12:24 +0000 (23:12 +0000)]
Pass the packet length explicitly around.

MFC after: 3 days

12 years agoRemove redundant check.
Michael Tuexen [Sun, 24 Jun 2012 22:22:44 +0000 (22:22 +0000)]
Remove redundant check.

MFC after: 3 days

12 years agoDo packet logging in a consistent way.
Michael Tuexen [Sun, 24 Jun 2012 21:25:54 +0000 (21:25 +0000)]
Do packet logging in a consistent way.

MFC after: 3 days

12 years agoClean up multi-id mode so it's driven by the f/w loaded,
Matt Jacob [Sun, 24 Jun 2012 17:30:54 +0000 (17:30 +0000)]
Clean up multi-id mode so it's driven by the f/w loaded,
not by some hint setting.  Do more preparations for FC-Tape.
Clean up resource counting for 24XX or later chipsets so
we find out after EXEC_FIRMWARE what is actually supported.
Set target mode exchange count based upon whether or not
we are supporting simultaneous target/initiator mode. Clean
up some old (pre-24XX) xfwoption and zfwoption issues.

Sponsored by: Spectralogic
MFC after: 3 days

12 years agoAdd the sys directory we create to the list of items to clean.
Andrew Turner [Sun, 24 Jun 2012 09:19:24 +0000 (09:19 +0000)]
Add the sys directory we create to the list of items to clean.

12 years agoIn a complete lack of foresight on my part, my previous commit broke
Adrian Chadd [Sun, 24 Jun 2012 08:47:19 +0000 (08:47 +0000)]
In a complete lack of foresight on my part, my previous commit broke
the assumption that ath_softc doesn't change size based on build time
configuration.

I picked up on this because suddenly radar stuff didn't work; and
although the ath_dfs code was setting sc_dodfs=1, the main ath driver
saw sc_dodfs=0.

So for now, include opt_ath.h in driver source files.  This seems like
the sane thing to do anyway.

I'll have to do a pass over the code at some later stage and turn
the radiotap TX/RX structs into malloc'ed memory, rather than in-line
inside of ath_softc.  I'd rather like to keep ath_softc the same
layout regardless of configuration parameters.

Pointy hat to:  adrian

12 years agoCreate a symlink to sys/elf32.h, sys/elf64.h, and sys/elf_common.h.
Andrew Turner [Sun, 24 Jun 2012 08:43:34 +0000 (08:43 +0000)]
Create a symlink to sys/elf32.h, sys/elf64.h, and sys/elf_common.h.

When building libelf in the bootstrap stage this would include the tree
versions of, for example, sys/_types.h. This would work as long as the
tree's version of this file was close enough to the system's version of
the file. If, however, there was a change in the tree such that the location
of a typedef was moved this would cause problems. In this case the version
of sys/_types.h in the tree no longer defines __wchar_t and expects it to
to be defined in machine/_types.h, however we pick up machine/_types.h from
the system and find it is not defined there. The solution is to restrict the
parts of sys er include from the tree to those that are needed.

This fixes the recent Tinderbox failure.

Pointy Hat to: andrew

12 years agoShuffle these initialisations to where they should be.
Adrian Chadd [Sun, 24 Jun 2012 08:28:06 +0000 (08:28 +0000)]
Shuffle these initialisations to where they should be.

12 years agoChange the ath_dfs_process_phy_err() method to take an mbuf rather than
Adrian Chadd [Sun, 24 Jun 2012 08:09:06 +0000 (08:09 +0000)]
Change the ath_dfs_process_phy_err() method to take an mbuf rather than
a buffer pointer.

For large radar pulses, the AR9130 and later will return a series of
FFT results for software processing.  These can overflow a single 2KB
buffer on longer pulses.  This would result in undefined buffer behaviour.

12 years agoFix mandoc "Oc breaks Op" warning.
Joel Dahl [Sun, 24 Jun 2012 07:54:28 +0000 (07:54 +0000)]
Fix mandoc "Oc breaks Op" warning.

12 years agoRemove the assert added in r237286
Eitan Adler [Sun, 24 Jun 2012 07:03:22 +0000 (07:03 +0000)]
Remove the assert added in r237286
The use of assertions in libraries is not widely accepted.

Requested by: bde, scottl
Approved by: cperciva
MFC after: 3 days
X-MFC-With: r237286

12 years agoIntroduce an optional ath(4) radiotap vendor extension.
Adrian Chadd [Sun, 24 Jun 2012 07:01:49 +0000 (07:01 +0000)]
Introduce an optional ath(4) radiotap vendor extension.

This includes a few new fields in each RXed frame:

* per chain RX RSSI (ctl and ext);
* current RX chainmask;
* EVM information;
* PHY error code;
* basic RX status bits (CRC error, PHY error, etc).

This is primarily to allow me to do some userland PHY error processing
for radar and spectral scan data.  However since EVM and per-chain RSSI
is provided, others may find it useful for a variety of tasks.

The default is to not compile in the radiotap vendor extensions, primarily
because tcpdump doesn't seem to handle the particular vendor extension
layout I'm using, and I'd rather not break existing code out there that
may be (badly) parsing the radiotap data.

Instead, add the option 'ATH_ENABLE_RADIOTAP_VENDOR_EXT' to your kernel
configuration file to enable these options.

12 years agoOn second thought, let's just set both CRC and PHY errors together on
Adrian Chadd [Sun, 24 Jun 2012 06:37:28 +0000 (06:37 +0000)]
On second thought, let's just set both CRC and PHY errors together on
frames that have it and let the upper layer sort it out.

PR: kern/169362

12 years agoSometimes the AR5416 sends back radar PHY errors with both the PHY error
Adrian Chadd [Sun, 24 Jun 2012 05:59:32 +0000 (05:59 +0000)]
Sometimes the AR5416 sends back radar PHY errors with both the PHY error
and the CRC error bits set.  The radar payload is correct.

When this happens, the stack doesn't see them PHY error frames and
isn't interpreted as a PHY error.  So, no radar detection and no radiotap
PHY error handling.

Now, this may introduce some weird issues if the MAC sends up some other
combination of CRC error + PHY error frames; this commit would break that
and mark them as PHY errors instead of CRC errors.

I may tinker with this a little more to pass radar/early radar/spectral
frames up as PHY errors if the CRC bit is set, to restore the previous
behaviour (where if CRC is set on a PHY error frame, it's marked as a CRC
error rather than PHY error.)

Tested on: AR5416, over the air, to a USRP N200 which is generating a
large number of a variety of radar pulses.
TODO: Test on AR9130, AR9160, AR9280 (and maybe radar pulses on
2GHz on AR9285/AR9287.)

PR: kern/169362

12 years agoFix a bug which causes a panic in daopen(). The panic is caused by
Kenneth D. Merry [Sun, 24 Jun 2012 04:29:03 +0000 (04:29 +0000)]
Fix a bug which causes a panic in daopen(). The panic is caused by
a da(4) instance going away while GEOM is still probing it.

In this case, the GEOM disk class instance has been created by
disk_create(), and the taste of the disk is queued in the GEOM
event queue.

While that event is queued, the da(4) instance goes away.  When the
open call comes into the da(4) driver, it dereferences the freed
(but non-NULL) peripheral pointer provided by GEOM, which results
in a panic.

The solution is to add a callback to the GEOM disk code that is
called when all of its resources are cleaned up.  This is
implemented inside GEOM by adding an optional callback that is
called when all consumers have detached from a provider, and the
provider is about to be deleted.

scsi_cd.c,
scsi_da.c: In the register routine for the cd(4) and da(4)
routines, acquire a reference to the CAM peripheral
instance just before we call disk_create().

Use the new GEOM disk d_gone() callback to register
a callback (dadiskgonecb()/cddiskgonecb()) that
decrements the peripheral reference count once GEOM
has finished cleaning up its resources.

In the cd(4) driver, clean up open and close
behavior slightly.  GEOM makes sure we only get one
open() and one close call, so there is no need to
set an open flag and decrement the reference count
if we are not the first open.

In the cd(4) driver, use cam_periph_release_locked()
in a couple of error scenarios to avoid extra mutex
calls.

geom.h: Add a new, optional, providergone callback that
is called when a provider is about to be deleted.

geom_disk.h: Add a new d_gone() callback to the GEOM disk
interface.

Bump the DISK_VERSION to version 2.  This probably
should have been done after a couple of previous
changes, especially the addition of the d_getattr()
callback.

geom_disk.c: Add a providergone callback for the disk class,
g_disk_providergone(), that calls the user's
d_gone() callback if it exists.

Bump the DISK_VERSION to 2.

geom_subr.c: In g_destroy_provider(), call the providergone
callback if it has been provided.

In g_new_geomf(), propagate the class's
providergone callback to the new geom instance.

blkfront.c: Callers of disk_create() are supposed to pass in
DISK_VERSION, not an explicit disk API version
number.  Update the blkfront driver to do that.

disk.9: Update the disk(9) man page to include information
on the new d_gone() callback, as well as the
previously added d_getattr() callback, d_descr
field, and HBA PCI ID fields.

MFC after: 5 days

12 years agoMake the wchar_t type machine dependent.
Andrew Turner [Sun, 24 Jun 2012 04:15:58 +0000 (04:15 +0000)]
Make the wchar_t type machine dependent.

This is required for ARM EABI. Section 7.1.1 of the Procedure Call for the
ARM Architecture (AAPCS) defines wchar_t as either an unsigned int or an
unsigned short with the former preferred.

Because of this requirement we need to move the definition of __wchar_t to
a machine dependent header. It also cleans up the macros defining the limits
of wchar_t by defining __WCHAR_MIN and __WCHAR_MAX in the same machine
dependent header then using them to define WCHAR_MIN and WCHAR_MAX
respectively.

Discussed with: bde

12 years agoIntroduce reserve_pv_entry() and use it in pmap_pv_demote_pde(). In order
Alan Cox [Sat, 23 Jun 2012 22:54:25 +0000 (22:54 +0000)]
Introduce reserve_pv_entry() and use it in pmap_pv_demote_pde().  In order
to add PV list locking to pmap_pv_demote_pde(), it is necessary to change
the way that pmap_pv_demote_pde() allocates PV entries.  Specifically,
once pmap_pv_demote_pde() begins modifying the PV lists, it can't allocate
any new PV chunks, because that could require the PV list lock to be
dropped.  So, all necessary PV chunks must be allocated in advance.  To my
surprise, this new approach is a few percent faster than the old one.

12 years agoBetter way to determine the status page length and rx pad boundary.
Navdeep Parhar [Sat, 23 Jun 2012 22:12:27 +0000 (22:12 +0000)]
Better way to determine the status page length and rx pad boundary.

12 years agoRemove superfluous paragraph macro.
Joel Dahl [Sat, 23 Jun 2012 20:44:45 +0000 (20:44 +0000)]
Remove superfluous paragraph macro.

12 years agoAdd description about dev.acpi_ibm.0.handlerevents.
Mitsuru IWASAKI [Sat, 23 Jun 2012 18:45:32 +0000 (18:45 +0000)]
Add description about dev.acpi_ibm.0.handlerevents.

MFC after: 3 days

12 years agoAdd in-driver event handler.
Mitsuru IWASAKI [Sat, 23 Jun 2012 18:43:54 +0000 (18:43 +0000)]
Add in-driver event handler.

MFC after: 3 days

12 years agoCorrect device id for GPU on some server SandyBridge model.
Konstantin Belousov [Sat, 23 Jun 2012 15:36:32 +0000 (15:36 +0000)]
Correct device id for GPU on some server SandyBridge model.

Submitted and tested by: Thomas Zander <thomas.e.zander googlemail com>
MFC after: 3 days

12 years agoUnbreak options ZFS after r236884.
Marius Strobl [Sat, 23 Jun 2012 14:43:25 +0000 (14:43 +0000)]
Unbreak options ZFS after r236884.

12 years agoRelease the ADB keyboard mutex when handling the power button
Justin Hibbits [Sat, 23 Jun 2012 13:52:44 +0000 (13:52 +0000)]
Release the ADB keyboard mutex when handling the power button
press/release.  Found by WITNESS.

Approved by: nwhitehorn (mentor)
MFC after: 3 days

12 years agoFix interface matching by ipfw table
Alexander V. Chernikov [Sat, 23 Jun 2012 12:40:24 +0000 (12:40 +0000)]
Fix interface matching by ipfw table

Submitted by:     Ihor Kaharlichenko <madkinder@gmail.com>
Tested by:        Ihor Kaharlichenko <madkinder@gmail.com>
Approved by:      kib(mentor)
MFC after:        3 days

12 years agoAdd scsi_extract_sense_ccb() -- wrapper around scsi_extract_sense_len().
Alexander Motin [Sat, 23 Jun 2012 12:32:53 +0000 (12:32 +0000)]
Add scsi_extract_sense_ccb() -- wrapper around scsi_extract_sense_len().
It allows to remove number of duplicate checks from several places.

12 years agoMove the code dealing with shared page into a dedicated
Konstantin Belousov [Sat, 23 Jun 2012 10:15:23 +0000 (10:15 +0000)]
Move the code dealing with shared page into a dedicated
kern_sharedpage.c source file from kern_exec.c.

MFC after:   29 days

12 years agoRemove no longer needed forward declaration for struct sf_buf.
Konstantin Belousov [Sat, 23 Jun 2012 10:14:51 +0000 (10:14 +0000)]
Remove no longer needed forward declaration for struct sf_buf.

MFC after:  29 days

12 years agoStop updating the struct vdso_timehands from even handler executed in
Konstantin Belousov [Sat, 23 Jun 2012 09:33:06 +0000 (09:33 +0000)]
Stop updating the struct vdso_timehands from even handler executed in
the scheduled task from tc_windup(). Do it directly from tc_windup in
interrupt context [1].

Establish the permanent mapping of the shared page into the kernel
address space, avoiding the potential need to sleep waiting for
allocation of sf buffer during vdso_timehands update. As a
consequence, shared_page_write_start() and shared_page_write_end()
functions are not needed anymore.

Guess and memorize the pointers to native host and compat32 sysentvec
during initialization, to avoid the need to get shared_page_alloc_sx
lock during the update.

In tc_fill_vdso_timehands(), do not loop waiting for timehands
generation to stabilize, since vdso_timehands is written in the same
interrupt context which wrote timehands.

Requested by:   mav [1]
MFC after:   29 days

12 years agoDo not allocate extra vectors when adapter is not TOE
Navdeep Parhar [Fri, 22 Jun 2012 22:59:42 +0000 (22:59 +0000)]
Do not allocate extra vectors when adapter is not TOE
capable (or toecaps have been disallowed by the user).

+ one very minor unrelated cleanup in t4_sge.c

12 years agoReturn CAM_SEL_TIMEOUT and CAM_DEV_NOT_THERE instead of CAM_TID_INVALID
Alexander Motin [Fri, 22 Jun 2012 21:46:41 +0000 (21:46 +0000)]
Return CAM_SEL_TIMEOUT and CAM_DEV_NOT_THERE instead of CAM_TID_INVALID
and CAM_LUN_INVALID for case of missing devices. In removes tons of error
messages from CAM during bus scans.

Reported and tested by: Mike Tancsa <mike@sentex.net>
MFC after: 3 days

12 years agoJust add a comment to further investigate when being closer to that code
Bjoern A. Zeeb [Fri, 22 Jun 2012 21:26:35 +0000 (21:26 +0000)]
Just add a comment to further investigate when being closer to that code
again next time.  The condition of the 2nd if() is very unlikely ever met.

12 years agoImport Illumos revision 13736:9f1d48e1681f
Martin Matuska [Fri, 22 Jun 2012 20:42:11 +0000 (20:42 +0000)]
Import Illumos revision 13736:9f1d48e1681f
2901 ZFS receive fails for exabyte sparse files

References:
https://www.illumos.org/issues/2901

Obtained from: illumos (issue #2901)
MFC after: 1 week

12 years agoChange 'camcontrol defects' to first probe a drive to find out how much
Kenneth D. Merry [Fri, 22 Jun 2012 18:57:06 +0000 (18:57 +0000)]
Change 'camcontrol defects' to first probe a drive to find out how much
defect information it has before grabbing the full defect list.

This works around a bug with some Hitachi drives that generate data overrun
errors when they are asked for more defect data than they have.

The change is done in a spec-compliant way, so it should have no negative
impact on drives that don't have this issue.

This is based on work originally done at Sandvine.

scsi_da.h: Add a define for the maximum amount of data that can be
contained in a defect list.

camcontrol.c: Update the readdefects() function to issue an initial
command to determine the length of the defect list, and
then use that length in the request for the full defect
list.

camcontrol.8: Add a note that some drives will report 0 defects available
if you don't request either the PLIST or GLIST.

Submitted by: Mark Johnston <markjdb@gmail.com> (original version)
MFC after: 3 days

12 years ago- Add a comment explaining the locking of the cached pages pool held
Attilio Rao [Fri, 22 Jun 2012 18:34:11 +0000 (18:34 +0000)]
- Add a comment explaining the locking of the cached pages pool held
  by vm_objects.
- Add flags for the per-object lock and free pages queue mutex lock.
  Use the newly added flags to mark the cache root within the vm_object
  structure.

Please note that other vm_object members should be marked with correct
locking but they are left for other commits.

In collabouration with: alc

MFC after: 3 days3 days3 days

12 years agoMerge changes from upstream libedit.
Pedro F. Giffuni [Fri, 22 Jun 2012 18:01:22 +0000 (18:01 +0000)]
Merge changes from upstream libedit.

Our libedit has been diverging from the mainstream version
maintained in NetBSD. As a consequence it has been difficult
to do an appropriate MFV and we have been bringing only
partial updates.

Here we update most of the files to at least match the
version available in NetBSD's snapshot of 20091228. This
version was chosen because it still doesn't include wide
character support (UTF-8), which involves many changes and
new files.

From NetBSD's logs:

Dec 15 22:13:33 2006 - editline.3 el.c el.h histedit.h
add EL_GETFP, and EL_SETFP.

Apr 5 15:53:28 2008 - editline.3 el.c histedit.h readline.c
add EL_REFRESH for the benefit of readline

Sep 10 15:45:37 2008 - common.c el.c read.c refresh.c sig.c term.c term.h tty.c
Allow a single process to control multiple ttys (for pthreads using _REENTRANT)
using multiple EditLine objects.

Jan 18 12:17:24 2009 - el.c read.c readline.c
fix -Wsign-compare issues

Feb 6 14:40:32 2009 - history.c
Plug memory leak, from MySQL.

Feb 5 19:15:44 2009 - histedit.h read.c
match documentation in el_push

Feb 6 13:14:37 2009 - vi.c
Portability fix.

Feb 12 13:39:49 2009 - readline.c term.c
More fixes for existing portability stuff.

Feb 15 21:24:13 2009 - el.h read.c
don't restart on EINTR, instead return NULL immediately. From Anon Ymous

Feb 15 21:25:01 2009 - sig.c sig.h
in order for read() to return EINTR we need to use sigaction, not signal,
otherwise SA_RESTART is set.

Feb 15 21:55:23 2009 - chared.c chared.h common.c emacs.c filecomplete.c
filecomplete.h key.c key.h read.c readline.c refresh.c search.c
term.c tokenizer.c tty.c vi.c
pass lint on _LP64.

Feb 17 21:34:26 2009 - el.c histedit.h prompt.c prompt.h
allow for a prompt argument.

Feb 18 15:04:40 2009 - sig.c
SA_RESTART for all signals but SIGINT. From Anon Ymous.

Feb 19 15:20:22 2009 - read.c sig.c sig.h
reset and redraw on sigcont. From Anon Ymous.

Feb 21 23:31:56 2009 - key.c key.h readline.c vi.c
more size_t stuff.

Mar 10 20:46:15 2009 - editline.3 read.c
make el_gets set the count to -1 on error to distinguish between EOF and
error.

Mar 31 17:38:27 2009 - editline.3 el.c histedit.h prompt.c prompt.h
refresh.c term.c term.h
Implement literal prompt sequences. Now someone can implement
RL_PROMPT_START_LITERAL/RL_PROMPT_END_LITERAL :-)

Mar 31 21:33:17 2009 - term.c
cast to size_t to avoid sign / unsigned comparison warning.

Apr 23 02:03 2009 - term.c
Apply patch (requested by msaitoh in ticket #2007):
Coverity CID 1668: Plug memory leak when malloc() failed.:55 2009

May 11 18:33:30 2009 - editline.3 el.c histedit.h
restore binary compatibility by providing new prompt functions that take
an extra literal character.

May 19 21:45:14 2009 - refresh.c
always scroll when we advance past bottom. From Caleb Welton
cwelton at greenplum dot com.

Jul 17 12:27:57 2009 - term.c
- off by one in the term.h case.
- make code more similar to tcsh (if we want to handle wide chars, this is
  needed; for now it is a no-op)

Jul 22 15:56:29 2009 - el.c
Move filename to the scope it is being used.
From Michael Cook mcook at bbn dot com

Jul 22 15:57:00 2009 - read.c
Always initialize nread since it is an out param.
From Michael Cook mcook at bbn dot com

Jul 22 18:25:26 2009 - el.c
Only need path if we have issetugid... From Anon Ymous

Jul 25 21:19:23 2009 - el.c
Ignore comment lines in .editrc from Jess Thrysoee

Sep 7 21:24:33 2009
histedit.h history.c readline.c
apply apple patches from:
http://opensource.apple.com/source/libedit/libedit-11/patches/

Dec 28 21:52:43 2009 - refresh.c
Fix bug where tab completion on the second or > line that caused listing
ended up corrupting the display by an extra space in the beginning. Reported
by Mac Chan.

Dec 28 22:15:36 2009 - refresh.c term.c
reduce diff with tcsh

Obtained from: NetBSD
Tested by: bapt, jilles and current@
MFC after: 1 week

12 years agoDon't print SCSI Queue Full and CAM_REQUEUE_REQ statuses as errors if they
Alexander Motin [Fri, 22 Jun 2012 16:20:13 +0000 (16:20 +0000)]
Don't print SCSI Queue Full and CAM_REQUEUE_REQ statuses as errors if they
were handled and retried. They are part of normal operation for SCSI TCQ.

MFC after: 3 days

12 years agoCommit changes missed from r237435. Properly calculate the signal
Konstantin Belousov [Fri, 22 Jun 2012 16:05:56 +0000 (16:05 +0000)]
Commit changes missed from r237435.  Properly calculate the signal
trampoline addresses after the shared page is enabled.  Handle FreeBSD
ABIs without shared page support too.

Reported and tested by: David Wolfskill <david catwhisker org>
 (previous version)
Pointy hat to: kib
MFC after:   1 month

12 years agoDo not read registers with read side effects while performing a register
Navdeep Parhar [Fri, 22 Jun 2012 08:37:33 +0000 (08:37 +0000)]
Do not read registers with read side effects while performing a register
dump for cxgbetool.

12 years agocxgbe(4): update to firmware interface 1.5.2.0; updates to shared code.
Navdeep Parhar [Fri, 22 Jun 2012 07:51:15 +0000 (07:51 +0000)]
cxgbe(4): update to firmware interface 1.5.2.0; updates to shared code.

12 years agoEnable shared page on i386, now it has a use for vdso_timehands.
Konstantin Belousov [Fri, 22 Jun 2012 07:16:29 +0000 (07:16 +0000)]
Enable shared page on i386, now it has a use for vdso_timehands.

MFC after: 1 month

12 years agoUse struct vdso_timehands data to implement fast gettimeofday(2) and
Konstantin Belousov [Fri, 22 Jun 2012 07:13:30 +0000 (07:13 +0000)]
Use struct vdso_timehands data to implement fast gettimeofday(2) and
clock_gettime(2) functions if supported. The speedup seen in
microbenchmarks is in range 4x-7x depending on the hardware.

Only amd64 and i386 architectures are supported. Libc uses rdtsc and
kernel data to calculate current time, if enabled by kernel.

Hopefully, this code is going to migrate into vdso in some future.

Discussed with: bde
Reviewed by: jhb
Tested by: flo
MFC after: 1 month

12 years agoImplement mechanism to export some kernel timekeeping data to
Konstantin Belousov [Fri, 22 Jun 2012 07:06:40 +0000 (07:06 +0000)]
Implement mechanism to export some kernel timekeeping data to
usermode, using shared page.  The structures and functions have vdso
prefix, to indicate the intended location of the code in some future.

The versioned per-algorithm data is exported in the format of struct
vdso_timehands, which mostly repeats the content of in-kernel struct
timehands. Usermode reading of the structure can be lockless.
Compatibility export for 32bit processes on 64bit host is also
provided. Kernel also provides usermode with indication about
currently used timecounter, so that libc can fall back to syscall if
configured timecounter is unknown to usermode code.

The shared data updates are initiated both from the tc_windup(), where
a fast task is queued to do the update, and from sysctl handlers which
change timecounter. A manual override switch
kern.timecounter.fast_gettime allows to turn off the mechanism.

Only x86 architectures export the real algorithm data, and there, only
for tsc timecounter. HPET counters page could be exported as well, but
I prefer to not further glue the kernel and libc ABI there until
proper vdso-based solution is developed.

Minimal stubs neccessary for non-x86 architectures to still compile
are provided.

Discussed with: bde
Reviewed by: jhb
Tested by: flo
MFC after: 1 month

12 years agoFix a stray debug that I committed accidentally years ago...
Warner Losh [Fri, 22 Jun 2012 06:44:22 +0000 (06:44 +0000)]
Fix a stray debug that I committed accidentally years ago...

12 years agoEnchance the shared page chunk allocator.
Konstantin Belousov [Fri, 22 Jun 2012 06:39:28 +0000 (06:39 +0000)]
Enchance the shared page chunk allocator.

Do not rely on the busy state of the page from which we allocate the
chunk, to protect allocator state. Use statically allocated sx lock
instead.

Provide more flexible KPI. In particular, allow to allocate chunk
without providing initial data, and allow writes into existing
allocation. Allow to get an sf buf which temporary maps the chunk, to
allow sequential updates to shared page content without unmapping in
between.

Reviewed by: jhb
Tested by: flo
MFC after: 1 month

12 years agoReserve AT_TIMEKEEP auxv entry for providing usermode the pointer to
Konstantin Belousov [Fri, 22 Jun 2012 06:38:31 +0000 (06:38 +0000)]
Reserve AT_TIMEKEEP auxv entry for providing usermode the pointer to
timekeeping information.

MFC after:  1 week

12 years agoMove these #defines to at91reg.h (where I should have put them in the
Warner Losh [Fri, 22 Jun 2012 05:54:34 +0000 (05:54 +0000)]
Move these #defines to at91reg.h (where I should have put them in the
first place).

12 years agoIntroduce CHANGE_PV_LIST_LOCK_TO_{PHYS,VM_PAGE}() to avoid duplication of
Alan Cox [Fri, 22 Jun 2012 05:01:36 +0000 (05:01 +0000)]
Introduce CHANGE_PV_LIST_LOCK_TO_{PHYS,VM_PAGE}() to avoid duplication of
code.

12 years agoMerge ACPICA 20120620.
Jung-uk Kim [Fri, 22 Jun 2012 00:40:44 +0000 (00:40 +0000)]
Merge ACPICA 20120620.

12 years agoAdd PCI IDs for Ivy Bridge
Ed Maste [Thu, 21 Jun 2012 22:06:57 +0000 (22:06 +0000)]
Add PCI IDs for Ivy Bridge

12 years agoMFV: Update zlib to 1.2.7.
Xin LI [Thu, 21 Jun 2012 21:47:08 +0000 (21:47 +0000)]
MFV: Update zlib to 1.2.7.

(x86 assembler optimization disabled for now because it
requires the new .cfi_* directives that is not supported
by base system binutils).

MFC after: 1 week

12 years agoAdd the functions documented in the man pages in commit 237393 to the
Isabell Long [Thu, 21 Jun 2012 18:28:48 +0000 (18:28 +0000)]
Add the functions documented in the man pages in commit 237393 to the
relevant Makefile.

Reminded by: gavin
Approved by: gabor (mentor)
MFC after: 5 days

12 years agoFix "comparison is always true due to limited range of data type" warning
Jung-uk Kim [Thu, 21 Jun 2012 18:22:50 +0000 (18:22 +0000)]
Fix "comparison is always true due to limited range of data type" warning
from GCC in the base system.  Note this patch was submitted upstream and it
will appear in the next ACPICA release.

Discussed with: Moore, Robert (robert dot moore at intel dot com)

12 years agoBring a couple of fixes for gcc optimizations.
Pedro F. Giffuni [Thu, 21 Jun 2012 16:49:20 +0000 (16:49 +0000)]
Bring a couple of fixes for gcc optimizations.

The GCC4.3 branch contains some optimization fixes
that were not considered regressions and therefore
were never backported. We are bringing a couple of
them that are under GPLv2 since they were made
before the license switch upstream.

While here, add the GCC revision numbers in the
log.

Discussed with: jkim
MFC after: 1 week

12 years agoUpdate the PV stats in free_pv_entry() using atomics. After which, it is
Alan Cox [Thu, 21 Jun 2012 16:37:36 +0000 (16:37 +0000)]
Update the PV stats in free_pv_entry() using atomics.  After which, it is
no longer necessary for free_pv_entry() to be serialized by the pvh global
lock.

Retire pmap_insert_entry() and pmap_remove_entry().  Once upon a time,
these functions were called from multiple places within the pmap.  Now,
each has only one caller.

12 years agoBe explicit about the dependency on nsparser.h.
David E. O'Brien [Thu, 21 Jun 2012 15:47:06 +0000 (15:47 +0000)]
Be explicit about the dependency on nsparser.h.

12 years agoMake cam_periph_hold() behavior consistent: drop taken reference and
Alexander Motin [Thu, 21 Jun 2012 15:14:51 +0000 (15:14 +0000)]
Make cam_periph_hold() behavior consistent: drop taken reference and
return ENXIO if periph was invalidated while we were waiting for it.

MFC after: 1 week

12 years agoIn camisr() clear CAM_SIM_ON_DONEQ flag after camisr_runqueue() purged SIM
Alexander Motin [Thu, 21 Jun 2012 14:35:46 +0000 (14:35 +0000)]
In camisr() clear CAM_SIM_ON_DONEQ flag after camisr_runqueue() purged SIM
done queue. Clearing it before caused extra SIM queueing in some cases.
It was invisible during normal operation, but during USB device unplug and
respective SIM destruction it could keep pointer on SIM without having
counted reference and as result crash the system by use afer free.

Reported by: hselasky
MFC after: 1 week

12 years agoAdd more locale-specific functions to the relevant man pages:
Isabell Long [Thu, 21 Jun 2012 12:52:15 +0000 (12:52 +0000)]
Add more locale-specific functions to the relevant man pages:
- libc/string/strcoll.3
- libc/string/strstr.3
- libc/string/strxfrm.3
- libc/string/strcasecmp.3

Reviewed by: theraven, gabor
Approved by: gabor (mentor)
MFC after: 5 days

12 years agoRemove redundant #ifdef. Reported by gnn@.
Michael Tuexen [Thu, 21 Jun 2012 12:51:24 +0000 (12:51 +0000)]
Remove redundant #ifdef. Reported by gnn@.

MFC after: 3 days

12 years agoEnable deadlock avoidance code for NFS client.
Konstantin Belousov [Thu, 21 Jun 2012 09:26:06 +0000 (09:26 +0000)]
Enable deadlock avoidance code for NFS client.

MFC after: 2 weeks

12 years agoFix unbounded-length malloc, controlled from usermode. The added check
Konstantin Belousov [Thu, 21 Jun 2012 09:20:07 +0000 (09:20 +0000)]
Fix unbounded-length malloc, controlled from usermode. The added check
is performed before exact size of the buffer is calculated, but the
buffer cannot have size greater then the total space allocated for
extended attributes. The existing check is executing with precise
size, but it is too late, since buffer needs to be allocated in
advance.

Also, adapt to uio_resid being of ssize_t type.  Use lblktosize instead of
multiplying by fs block size by hand as well.

Reported and tested by:   pho
MFC after:   1 week

12 years agoFix locking for f_offset, vn_read() and vn_write() cases only, for now.
Konstantin Belousov [Thu, 21 Jun 2012 09:19:41 +0000 (09:19 +0000)]
Fix locking for f_offset, vn_read() and vn_write() cases only, for now.

It seems that intended locking protocol for struct file f_offset field
was as follows: f_offset should always be changed under the vnode lock
(except fcntl(2) and lseek(2) did not followed the rules). Since
read(2) uses shared vnode lock, FOFFSET_LOCKED block is additionally
taken to serialize shared vnode lock owners.

This was broken first by enabling shared lock on writes, then by
fadvise changes, which moved f_offset assigned from under vnode lock,
and last by vn_io_fault() doing chunked i/o. More, due to uio_offset
not yet valid in vn_io_fault(), the range lock for reads was taken on
the wrong region.

Change the locking for f_offset to always use FOFFSET_LOCKED block,
which is placed before rangelocks in the lock order.

Extract foffset_lock() and foffset_unlock() functions which implements
FOFFSET_LOCKED lock, and consistently lock f_offset with it in the
vn_io_fault() both for reads and writes, even if MNTK_NO_IOPF flag is
not set for the vnode mount. Indicate that f_offset is already valid
for vn_read() and vn_write() calls from vn_io_fault() with FOF_OFFSET
flag, and assert that all callers of vn_read() and vn_write() follow
this protocol.

Extract get_advice() function to calculate the POSIX_FADV_XXX value
for the i/o region, and use it were appropriate.

Reviewed by: jhb
Tested by: pho
MFC after: 2 weeks

12 years agoRemove Moxa CP-132EL definition (RS422/485-only board).
Max Khon [Thu, 21 Jun 2012 04:57:59 +0000 (04:57 +0000)]
Remove Moxa CP-132EL definition (RS422/485-only board).

12 years agoAdd support for the following Moxa PCIe multiport serial boards:
Max Khon [Thu, 21 Jun 2012 03:10:48 +0000 (03:10 +0000)]
Add support for the following Moxa PCIe multiport serial boards:
- CP102E
- CP102EL
- CP132EL
- CP114EL
- CP118EL-A
- CP168EL-A

MFC after: 1 week