]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years ago- Currently, sched_balance_pair() may cause a CPU to send an IPI_PREEMPT to
marius [Thu, 6 Oct 2011 11:48:13 +0000 (11:48 +0000)]
- Currently, sched_balance_pair() may cause a CPU to send an IPI_PREEMPT to
  itself, which sparc64 hardware doesn't support. One way to solve this
  would be to directly call sched_preempt() instead of issuing a self-IPI.
  However, quoting jhb@:
  "On the other hand, you can probably just skip the IPI entirely if we are
  going to send it to the current CPU.  Presumably, once this routine
  finishes, the current CPU will exit softlock (or will do so "soon") and
  will then pick the next thread to run based on the adjustments made in
  this routine, so there's no need to IPI the CPU running this routine
  anyway.  I think this is the better solution.  Right now what is probably
  happening on other platforms is as soon as this routine finishes the CPU
  processes its self-IPI and causes mi_switch() which will just switch back
  to the softclock thread it is already running."
- With r226054 and the the above change in place, sparc64 now no longer is
  incompatible with ULE and vice versa. However, powerpc/E500 still is.

Submitted by: jhb
Reviewed by: jeff

12 years ago- Use atomic operations rather than sched_lock for safely assigning pm_active
marius [Thu, 6 Oct 2011 11:01:31 +0000 (11:01 +0000)]
- Use atomic operations rather than sched_lock for safely assigning pm_active
  and pc_pmap for SMP. This is key to allowing adding support for SCHED_ULE.
  Thanks go to Peter Jeremy for additional testing.
- Add support for SCHED_ULE to cpu_switch().

Committed from: 201110DevSummit

12 years agoFix build on i386 and arm.
delphij [Thu, 6 Oct 2011 04:39:18 +0000 (04:39 +0000)]
Fix build on i386 and arm.

Tested with: make universe
Pointy hat to: delphij

12 years agoUpgrade to OpenSSH 5.9p1.
des [Wed, 5 Oct 2011 22:08:17 +0000 (22:08 +0000)]
Upgrade to OpenSSH 5.9p1.

MFC after: 3 months

12 years agoRemove assertion against empty NFSv4 ACLs. An empty ACL is not exactly
trasz [Wed, 5 Oct 2011 17:29:49 +0000 (17:29 +0000)]
Remove assertion against empty NFSv4 ACLs.  An empty ACL is not exactly
valid - we don't allow for setting it on a file, for example - but it's
not something we should assert on.

For STABLE kernel, it changes nothing, because it's not compiled with
INVARIANTS.  If it was, it would fix crashes.  It also fixes an assert
in libc encountered with NFSv4 without nfsuserd(8) running.

Submitted by: Yuri Pankov (earlier version)
MFC after: 1 month

12 years agoSupply unique (st_dev, st_ino) value pair for the fstat(2) done on the pipes.
kib [Wed, 5 Oct 2011 16:56:06 +0000 (16:56 +0000)]
Supply unique (st_dev, st_ino) value pair for the fstat(2) done on the pipes.

Reviewed by: jhb, Peter Jeremy <peterjeremy acm org>
MFC after: 2 weeks

12 years agoExport devfs inode number allocator for the kernel consumers.
kib [Wed, 5 Oct 2011 16:50:15 +0000 (16:50 +0000)]
Export devfs inode number allocator for the kernel consumers.

Reviewed by: jhb
MFC after: 2 weeks

12 years agoThe IFA_RTSELF instead of the IFA_ROUTE flag should be checked to
qingli [Wed, 5 Oct 2011 16:27:11 +0000 (16:27 +0000)]
The IFA_RTSELF instead of the IFA_ROUTE flag should be checked to
determine if a loopback route should be installed for an interface
IPv6 address. Another condition is the address must not belong to a
looopback interface.

Reviewed by: hrs
MFC after: 3 days

12 years agoIgnore SRAT memory entries if the memory range does not overlap with an
jhb [Wed, 5 Oct 2011 16:03:47 +0000 (16:03 +0000)]
Ignore SRAT memory entries if the memory range does not overlap with an
existing phys_avail[] table.  If a hw.physmem setting causes a memory
domain to not be present in phys_avail[], the SRAT table will now be
ignored rather than triggering a panic when a CPU in the missing domain
tries to allocate a page.

MFC after: 1 week

12 years agoUpdate BSD grep to the latest development version. It has some code
gabor [Wed, 5 Oct 2011 09:56:43 +0000 (09:56 +0000)]
Update BSD grep to the latest development version.  It has some code
backported that was written for the TRE integration project in Google
Summer of Code 2011.  This is a temporary solution until the whole
regex library is not replaced so that BSD grep development can continue
and the backported code gets some review and testing.  This change only
improves scalability slightly, there is no big performance boost yet
but several minor bugs have been found and fixed.

Approved by: delphij (mentor)
Sposored by: Google Summer of Code 2011
MFC after: 1 week

12 years agoAdd missing newbus glue, this has never attached properly to gpiobus.
thompsa [Wed, 5 Oct 2011 08:33:50 +0000 (08:33 +0000)]
Add missing newbus glue, this has never attached properly to gpiobus.

12 years agoAdd strnlen() to libkern.
jkim [Tue, 4 Oct 2011 23:53:47 +0000 (23:53 +0000)]
Add strnlen() to libkern.

12 years agoportsnap: Detect error immediately if we can't fetch the snapshot metadata.
jilles [Tue, 4 Oct 2011 22:28:06 +0000 (22:28 +0000)]
portsnap: Detect error immediately if we can't fetch the snapshot metadata.

Also add some quotes around command substitution where useful and possible.

Reviewed by: cperciva
MFC after: 1 week

12 years agoWork around the autotools problem with the 10.0 version.
jilles [Tue, 4 Oct 2011 22:23:00 +0000 (22:23 +0000)]
Work around the autotools problem with the 10.0 version.

With this, I can build various ports on a 10.0-CURRENT system without
hacking or hiding the version number.

This commit should be reverted when there is a cleaner fix in autotools
and/or ports/Mk/bsd.port.mk.

The original patch is from Ed Schouten but needed some additions.

12 years agoAdd the 9750 SATA+SAS 6Gb/s RAID controller card driver, tws(4). Many
delphij [Tue, 4 Oct 2011 21:40:25 +0000 (21:40 +0000)]
Add the 9750 SATA+SAS 6Gb/s RAID controller card driver, tws(4).  Many
thanks for their contiued support to FreeBSD.

This is version 10.80.00.003 from codeset 10.2.1 [1]

Obtained from: LSI http://kb.lsi.com/Download16574.aspx [1]

12 years agoAdd default address for FLASH mapping on the boot bus.
marcel [Tue, 4 Oct 2011 20:30:15 +0000 (20:30 +0000)]
Add default address for FLASH mapping on the boot bus.

Reviewed by: jmallett, marcel
Obtained from: Juniper Networks, Inc
Author: Andrew Duane

12 years agoRemove octeon_bootinfo from all files except octeon_machdep.c.
marcel [Tue, 4 Oct 2011 20:17:43 +0000 (20:17 +0000)]
Remove octeon_bootinfo from all files except octeon_machdep.c.
Use instead cvmx_sysinfo_get() consistently.

Reviewed by: jmallett, marcel
Obtained from: Juniper Networks, Inc
Author: Andrew Duane

12 years agoFix a bug in UNIX socket handling in the linux emulator which was
cperciva [Tue, 4 Oct 2011 19:07:38 +0000 (19:07 +0000)]
Fix a bug in UNIX socket handling in the linux emulator which was
exposed by the security fix in FreeBSD-SA-11:05.unix.

Approved by: so (cperciva)
Approved by: re (kib)
Security: Related to FreeBSD-SA-11:05.unix, but not actually
a security fix.

12 years agoMove parts of the commit log for r166167, where Tor explained the
kib [Tue, 4 Oct 2011 18:45:29 +0000 (18:45 +0000)]
Move parts of the commit log for r166167, where Tor explained the
interaction between vnode locks and vfs_busy(), into comment.

MFC after: 1 week

12 years agoRemove bogus and wrong definition of BLKDEV_IOSIZE.
marcel [Tue, 4 Oct 2011 18:06:08 +0000 (18:06 +0000)]
Remove bogus and wrong definition of BLKDEV_IOSIZE.
Wrong in that it must be guarded (it's configurable)
and bogus in that there's absolutely no rationale for
it not default to a page size like all other archs.

12 years agoo Clean up some ID printfs, and put under bootverbose
marcel [Tue, 4 Oct 2011 18:03:55 +0000 (18:03 +0000)]
o   Clean up some ID printfs, and put under bootverbose
o   Remove redundant lookups of base address in cf_identify
o   Fix some indenting issues
o   Fix an identification bug that uses DRQ to checlk for ident block
    returned. The correct spec is to look for BSY to be cleared.

Reviewed by: imp, marcel
Obtained from: Juniper Networks, Inc
Author: Andrew Duane

12 years agoPartially revert r224661:
marcel [Tue, 4 Oct 2011 17:49:19 +0000 (17:49 +0000)]
Partially revert r224661:
octeon_ap_boot is not a bitmask. It holds the CPU Id of the
AP currently being started. As such there's no need to make
it a 64-bit integral and we're not limited to 64 CPUs.

Reported by: jmallet
Obtained from: Andre Duane

12 years agoMatch the files directive and all the ways to add or subtract options
marcel [Tue, 4 Oct 2011 17:11:38 +0000 (17:11 +0000)]
Match the files directive and all the ways to add or subtract options
and makeoptions by being a little smarter about REs.

12 years agoProperly guard definitions of DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ and
marcel [Tue, 4 Oct 2011 17:00:50 +0000 (17:00 +0000)]
Properly guard definitions of DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ and
SGROWSIZ. They can be set in the kernel configuration file.

12 years agoFix build when DEBUG is defined in the kernel configuration file (e.g.
marcel [Tue, 4 Oct 2011 16:58:20 +0000 (16:58 +0000)]
Fix build when DEBUG is defined in the kernel configuration file (e.g.
LINT).

12 years agoInclude opt_* headers first. Otherwise we can end up with redefined
marcel [Tue, 4 Oct 2011 16:55:53 +0000 (16:55 +0000)]
Include opt_* headers first. Otherwise we can end up with redefined
symbols.

12 years agoFix build when DEBUG is defined (e.g. for LINT).
marcel [Tue, 4 Oct 2011 16:53:11 +0000 (16:53 +0000)]
Fix build when DEBUG is defined (e.g. for LINT).

12 years agolatin1 -> utf8
des [Tue, 4 Oct 2011 15:00:54 +0000 (15:00 +0000)]
latin1 -> utf8

12 years agoActually enforce limit for inheritable resources on fork.
trasz [Tue, 4 Oct 2011 14:56:33 +0000 (14:56 +0000)]
Actually enforce limit for inheritable resources on fork.

MFC after: 3 days

12 years agoHandle the situation where fixups_close() has been called but more fixups
adrian [Tue, 4 Oct 2011 14:26:45 +0000 (14:26 +0000)]
Handle the situation where fixups_close() has been called but more fixups
are still available on the queue.

Without this, the fixups producer/consumer pipeline will artifically terminate
before all of the fixups have been processed, leading to incomplete updates
and generally quite unhappy users.

Submitted by: mux

12 years agoUpdate the comment to reflect what is actually going on.
adrian [Tue, 4 Oct 2011 14:25:10 +0000 (14:25 +0000)]
Update the comment to reflect what is actually going on.

Submitted by: mux

12 years agoMFi386: revision 225936
nyan [Tue, 4 Oct 2011 13:24:22 +0000 (13:24 +0000)]
MFi386: revision 225936

  Add some improvements in the idle table callbacks:
  - Replace instances of manual assembly instruction "hlt" call
    with halt() function calling.
  - In cpu_idle_mwait() avoid races in check to sched_runnable() using
    the same pattern used in cpu_idle_hlt() with the 'hlt' instruction.
  - Add comments explaining the logic behind the pattern used in
    cpu_idle_hlt() and other idle callbacks.

12 years agoRemove no longer valid statement about ARM.
kib [Tue, 4 Oct 2011 13:15:12 +0000 (13:15 +0000)]
Remove no longer valid statement about ARM.

MFC after: 1 month

12 years agoConvert ARM to the syscallenter/syscallret system call sequence handlers.
kib [Tue, 4 Oct 2011 13:14:24 +0000 (13:14 +0000)]
Convert ARM to the syscallenter/syscallret system call sequence handlers.

Tested by: gber
MFC after: 1 month

12 years agoAdd an AR5416 aware version of the "current RSSI" function.
adrian [Tue, 4 Oct 2011 00:32:10 +0000 (00:32 +0000)]
Add an AR5416 aware version of the "current RSSI" function.

Pre-11n devices and AR5416 use AR_PHY(263) for current RX RSSI.
AR9130 and later have a fourth calibration register (for doing
ADC calibration) and thus the register has moved to AR_PHY(271).

This isn't currently used by any of the active code; I'm committing
this for completeness and in case any third party code attempts to
use it for legacy reasons.

12 years agoAllow ixp425 boot2 to compile after r219452
thompsa [Tue, 4 Oct 2011 00:15:40 +0000 (00:15 +0000)]
Allow ixp425 boot2 to compile after r219452

12 years agoDon't chop IO into small pieces, follow cp(1) and just use MAXPHYS.
ivoras [Mon, 3 Oct 2011 21:48:10 +0000 (21:48 +0000)]
Don't chop IO into small pieces, follow cp(1) and just use MAXPHYS.

12 years agoRevert r225875, r225877:
mav [Mon, 3 Oct 2011 21:19:15 +0000 (21:19 +0000)]
Revert r225875, r225877:
It is reported that on some chips (e.g. the 970MP) behavior of POW bit set
simultaneously with modifying other bits is undefined and may cause hangs.
The race should be handled in some other way, but for now just get back.

Reported by: nwitehorn

12 years agoNow that its only consumer is gone (sysinstall), remove libftpio as well.
nwhitehorn [Mon, 3 Oct 2011 20:49:02 +0000 (20:49 +0000)]
Now that its only consumer is gone (sysinstall), remove libftpio as well.

12 years agoFix a number of platform problems in this file (mostly assuming that only
nwhitehorn [Mon, 3 Oct 2011 20:46:36 +0000 (20:46 +0000)]
Fix a number of platform problems in this file (mostly assuming that only
amd64 has lib32).

12 years agoAdd descriptor sense support to CAM, and honor sense residuals properly in
ken [Mon, 3 Oct 2011 20:32:55 +0000 (20:32 +0000)]
Add descriptor sense support to CAM, and honor sense residuals properly in
CAM.

Desriptor sense is a new sense data format that originated in SPC-3.  Among
other things, it allows for an 8-byte info field, which is necessary to
pass back block numbers larger than 4 bytes.

This change adds a number of new functions to scsi_all.c (and therefore
libcam) that abstract out most access to sense data.

This includes a bump of CAM_VERSION, because the CCB ABI has changed.
Userland programs that use the CAM pass(4) driver will need to be
recompiled.

camcontrol.c: Change uses of scsi_extract_sense() to use
scsi_extract_sense_len().

Use scsi_get_sks() instead of accessing sense key specific
data directly.

scsi_modes: Update the control mode page to the latest version (SPC-4).

scsi_cmds.c,
scsi_target.c: Change references to struct scsi_sense_data to struct
scsi_sense_data_fixed.  This should be changed to allow the
user to specify fixed or descriptor sense, and then use
scsi_set_sense_data() to build the sense data.

ps3cdrom.c: Use scsi_set_sense_data() instead of setting sense data
manually.

cam_periph.c: Use scsi_extract_sense_len() instead of using
scsi_extract_sense() or accessing sense data directly.

cam_ccb.h: Bump the CAM_VERSION from 0x15 to 0x16.  The change of
struct scsi_sense_data from 32 to 252 bytes changes the
size of struct ccb_scsiio, but not the size of union ccb.
So the version must be bumped to prevent structure
mis-matches.

scsi_all.h: Lots of updated SCSI sense data and other structures.

Add function prototypes for the new sense data functions.

Take out the inline implementation of scsi_extract_sense().
It is now too large to put in a header file.

Add macros to calculate whether fields are present and
filled in fixed and descriptor sense data

scsi_all.c: In scsi_op_desc(), allow the user to pass in NULL inquiry
data, and we'll assume a direct access device in that case.

Changed the SCSI RESERVED sense key name and description
to COMPLETED, as it is now defined in the spec.

Change the error recovery action for a number of read errors
to prevent lots of retries when the drive has said that the
block isn't accessible.  This speeds up reconstruction of
the block by any RAID software running on top of the drive
(e.g. ZFS).

In scsi_sense_desc(), allow for invalid sense key numbers.
This allows calling this routine without checking the input
values first.

Change scsi_error_action() to use scsi_extract_sense_len(),
and handle things when invalid asc/ascq values are
encountered.

Add a new routine, scsi_desc_iterate(), that will call the
supplied function for every descriptor in descriptor format
sense data.

Add scsi_set_sense_data(), and scsi_set_sense_data_va(),
which build descriptor and fixed format sense data.  They
currently default to fixed format sense data.

Add a number of scsi_get_*() functions, which get different
types of sense data fields from either fixed or descriptor
format sense data, if the data is present.

Add a number of scsi_*_sbuf() functions, which print
formatted versions of various sense data fields.  These
functions work for either fixed or descriptor sense.

Add a number of scsi_sense_*_sbuf() functions, which have a
standard calling interface and print the indicated field.
These functions take descriptors only.

Add scsi_sense_desc_sbuf(), which will print a formatted
version of the given sense descriptor.

Pull out a majority of the scsi_sense_sbuf() function and
put it into scsi_sense_only_sbuf().  This allows callers
that don't use struct ccb_scsiio to easily utilize the
printing routines.  Revamp that function to handle
descriptor sense and use the new sense fetching and
printing routines.

Move scsi_extract_sense() into scsi_all.c, and implement it
in terms of the new function, scsi_extract_sense_len().
The _len() version takes a length (which should be the
sense length - residual) and can indicate which fields are
present and valid in the sense data.

Add a couple of new scsi_get_*() routines to get the sense
key, asc, and ascq only.

mly.c: Rename struct scsi_sense_data to struct
scsi_sense_data_fixed.

sbp_targ.c: Use the new sense fetching routines to get sense data
instead of accessing it directly.

sbp.c: Change the firewire/SCSI sense data transformation code to
use struct scsi_sense_data_fixed instead of struct
scsi_sense_data.  This should be changed later to use
scsi_set_sense_data().

ciss.c: Calculate the sense residual properly.  Use
scsi_get_sense_key() to fetch the sense key.

mps_sas.c,
mpt_cam.c: Set the sense residual properly.

iir.c: Use scsi_set_sense_data() instead of building sense data by
hand.

iscsi_subr.c: Use scsi_extract_sense_len() instead of grabbing sense data
directly.

umass.c: Use scsi_set_sense_data() to build sense data.

Grab the sense key using scsi_get_sense_key().

Calculate the sense residual properly.

isp_freebsd.h: Use scsi_get_*() routines to grab asc, ascq, and sense key
values.

Calculate and set the sense residual.

MFC after: 3 days
Sponsored by: Spectra Logic Corporation

12 years agoA system may have multiple physical interfaces, all of which are on the
qingli [Mon, 3 Oct 2011 19:51:18 +0000 (19:51 +0000)]
A system may have multiple physical interfaces, all of which are on the
same prefix. Since a single route entry is installed for the prefix
(without RADIX_MPATH), incoming packets on the interfaces that are not
associated with the prefix route may trigger an error message about
unable to allocation LLE entry, and fails L2. This patch makes sure a
valid route is present in the system, and allow the aforementioned
condition to exist and treats as valid.

Reviewed by: bz
MFC after: 5 days

12 years agoThis patch allows ARP to work properly in the presence of
qingli [Mon, 3 Oct 2011 19:06:55 +0000 (19:06 +0000)]
This patch allows ARP to work properly in the presence of
self-referencing routes. This patch is a rework of r223862.

Reviewed by: bz, zec
MFC after: 5 days

12 years agoRemove a redundant check for libncp.
jkim [Mon, 3 Oct 2011 18:05:51 +0000 (18:05 +0000)]
Remove a redundant check for libncp.

Submitted by: Alexander Sack (asack at niksun dot com)

12 years agoMove some code inside the racct_proc_fork(); it spares a few lock operations
trasz [Mon, 3 Oct 2011 17:40:55 +0000 (17:40 +0000)]
Move some code inside the racct_proc_fork(); it spares a few lock operations
and it's more logical this way.

MFC after: 3 days

12 years agoDo not allow the kernel to access usermode pages without installed
kib [Mon, 3 Oct 2011 17:01:31 +0000 (17:01 +0000)]
Do not allow the kernel to access usermode pages without installed
fault handler. Panic immediately in such situation, on i386 and amd64.

Reviewed by: avg, jhb
MFC after: 1 week

12 years agoAssert that exiting process does not return to usermode.
kib [Mon, 3 Oct 2011 16:58:58 +0000 (16:58 +0000)]
Assert that exiting process does not return to usermode.

Reviewed by: avg, jhb
MFC after: 1 week

12 years agoFix an unaligned access issue; tidy up OFDM/DS rate decoding from the PLCP.
adrian [Mon, 3 Oct 2011 16:30:18 +0000 (16:30 +0000)]
Fix an unaligned access issue; tidy up OFDM/DS rate decoding from the PLCP.

This fixes a panic on PPC.

Submitted by: novel
Obtained from: OpenBSD, sys/dev/ic/bwi.c r1.89

12 years agoFix another bug introduced in r225641, which caused rctl to access certain
trasz [Mon, 3 Oct 2011 16:23:20 +0000 (16:23 +0000)]
Fix another bug introduced in r225641, which caused rctl to access certain
fields in 'struct proc' before they got initialized in do_fork().

MFC after: 3 days

12 years agoFix bug introduced in r225641, which would cause panic if racct_proc_fork()
trasz [Mon, 3 Oct 2011 15:32:15 +0000 (15:32 +0000)]
Fix bug introduced in r225641, which would cause panic if racct_proc_fork()
returned error -- the racct_destroy_locked() would get called twice.

MFC after: 3 days

12 years agoFarewall, sysinstall! You served us well for many years, but 10.0 is one
nwhitehorn [Mon, 3 Oct 2011 15:13:09 +0000 (15:13 +0000)]
Farewall, sysinstall! You served us well for many years, but 10.0 is one
digit beyond your time.

Various sysinstall dependencies (e.g. libftpio, libdisk, libodialog, etc.)
will be cleaned up in coming days. Some will take longer than others due to
a few other consumers (tzsetup and sade).

12 years agoAdd some improvements in the idle table callbacks:
attilio [Mon, 3 Oct 2011 14:23:00 +0000 (14:23 +0000)]
Add some improvements in the idle table callbacks:
- Replace instances of manual assembly instruction "hlt" call
  with halt() function calling.
- In cpu_idle_mwait() avoid races in check to sched_runnable() using
  the same pattern used in cpu_idle_hlt() with the 'hlt' instruction.
- Add comments explaining the logic behind the pattern used in
  cpu_idle_hlt() and other idle callbacks.

In collabouration with: jhb, mav
Reviewed by: adri, kib
MFC after: 3 weeks

12 years agoPort over the radar pulse decoding code common to the AR5416 and later chipsets.
adrian [Mon, 3 Oct 2011 12:12:03 +0000 (12:12 +0000)]
Port over the radar pulse decoding code common to the AR5416 and later chipsets.

Obtained from: Atheros

12 years agoActually enable NEW_PCIB by default, missed in r225931.
marius [Sun, 2 Oct 2011 23:31:14 +0000 (23:31 +0000)]
Actually enable NEW_PCIB by default, missed in r225931.

12 years agoMake sparc64 compatible with NEW_PCIB and enable it:
marius [Sun, 2 Oct 2011 23:22:38 +0000 (23:22 +0000)]
Make sparc64 compatible with NEW_PCIB and enable it:
- Implement bus_adjust_resource() methods as far as necessary and in non-PCI
  bridge drivers as far as feasible without rototilling them.
- As NEW_PCIB does a layering violation by activating resources at layers
  above pci(4) without previously bubbling up their allocation there, move
  the assignment of bus tags and handles from the bus_alloc_resource() to
  the bus_activate_resource() methods like at least the other NEW_PCIB
  enabled architectures do. This is somewhat unfortunate as previously
  sparc64 (ab)used resource activation to indicate whether SYS_RES_MEMORY
  resources should be mapped into KVA, which is only necessary if their
  going to be accessed via the pointer returned from rman_get_virtual() but
  not for bus_space(9) as the later always uses physical access on sparc64.
  Besides wasting KVA if we always map in SYS_RES_MEMORY resources, a driver
  also may deliberately not map them in if the firmware already has done so,
  possibly in a special way. So in order to still allow a driver to decide
  whether a SYS_RES_MEMORY resource should be mapped into KVA we let it
  indicate that by calling bus_space_map(9) with BUS_SPACE_MAP_LINEAR as
  actually documented in the bus_space(9) page. This is implemented by
  allocating a separate bus tag per SYS_RES_MEMORY resource and passing the
  resource via the previously unused bus tag cookie so we later on can call
  rman_set_virtual() in sparc64_bus_mem_map(). As a side effect this now
  also allows to actually indicate that a SYS_RES_MEMORY resource should be
  mapped in as cacheable and/or read-only via BUS_SPACE_MAP_CACHEABLE and
  BUS_SPACE_MAP_READONLY respectively.
- Do some minor cleanup like taking advantage of rman_init_from_resource(),
  factor out the common part of bus tag allocation into a newly added
  sparc64_alloc_bus_tag(), hook up some missing newbus methods and replace
  some homegrown versions with the generic counterparts etc.
- While at it, let apb_attach() (which can't use the generic NEW_PCIB code
  as APB bridges just don't have the base and limit registers implemented)
  regarding the config space registers cached in pcib_softc and the SYSCTL
  reporting nodes set up.

12 years agoCorrect a typo that was introduced in 225912
gjb [Sun, 2 Oct 2011 16:05:19 +0000 (16:05 +0000)]
Correct a typo that was introduced in 225912

Submitted by: Valentin Nechayev (netch % netch!kiev!ua), arundel
MFC after: 1 week
With-MFC: 225908

12 years agoRemove an unused variable.
adrian [Sun, 2 Oct 2011 14:10:25 +0000 (14:10 +0000)]
Remove an unused variable.

12 years agoVarious interrupt handling and RX interrupt mitigation fixes.
adrian [Sun, 2 Oct 2011 14:08:56 +0000 (14:08 +0000)]
Various interrupt handling and RX interrupt mitigation fixes.

* The AR_ISR_RAC interrupt processing method has a subtle bug in all
  the MAC revisions (including pre-11n NICs) until AR9300v2.
  If you're unlucky, the clear phase clears an update to one of the
  secondary registers, which includes TX status.

  This shows up as a "watchdog timeout" if you're doing very low levels
  of TX traffic. If you're doing a lot of non-11n TX traffic, you'll
  end up receiving a TX interrupt from some later traffic anyway.

  But when TX'ing 11n aggregation session traffic (which -HEAD isn't yet
  doing), you may find that you're only able to TX one frame (due to
  BAW restrictions) and this may end up hitting this race condition.

  The only solution is to not use RAC and instead use AR_ISR and the
  AR_ISR_Sx registers. The bit in AR_ISR which represents the secondary
  registers are not cleared; only the AR_ISR_Sx bits are. This way
  any updates which occur between the read and subsequent write will
  stay asserted and (correctly) trigger a subsequent interrupt.

  I've tested this on the AR5416, AR9160, AR9280. I will soon test
  the AR9285 and AR9287.

* The AR_ISR TX and RX bits (and all others!) are set regardless of
  whether the contents of the AR_IMR register. So if RX mitigation is
  enabled, RXOK is going to be set in AR_ISR and it would normally set
  HAL_INT_RX.

  Fix the code to not set HAL_INT_RX when RXOK is set and RX mitigation
  is compiled in. That way the RX path isn't prematurely called.

  I would see:

  * An interrupt would come in (eg a beacon, or TX completion) where
    RXOK was set but RXINTM/RXMINT wasn't;
  * ath_rx_proc() be called - completing RX frames;
  * RXINTM/RXMINT would then fire;
  * ath_rx_proc() would then be called again but find no frames in the
    queue.

  This fixes the RX mitigation behaviour to not overly call ath_rx_proc().

* Start to flesh out more correct timer interrupt handling - it isn't
  kite/merlin specific. It's actually based on whether autosleep support
  is enabled or not.

This is sourced from my 11n TX branch and has been tested for a few weeks.

Finally, the interrupt handling change should likely be implemented
for AR5210, AR5211 and AR5212.

12 years agoDocument exactly what the RX interrupt mitigation timers do.
adrian [Sun, 2 Oct 2011 13:51:26 +0000 (13:51 +0000)]
Document exactly what the RX interrupt mitigation timers do.

12 years agoFor now (ie: until autosleep support is fully fleshed out), always clear
adrian [Sun, 2 Oct 2011 13:47:03 +0000 (13:47 +0000)]
For now (ie: until autosleep support is fully fleshed out), always clear
all of the RX status fields when initialising a new RX descriptor.

12 years agoDisable TX interrupt mitigation just for the time being.
adrian [Sun, 2 Oct 2011 13:43:06 +0000 (13:43 +0000)]
Disable TX interrupt mitigation just for the time being.

There are some timing concerns which I've yet to fully map out.
In any case, there's an existing software driven mitigation method
for TX interrupts and when TX'ing 11n frames, the whole frame itself
generates an interrupt rather then the subframes.

12 years agoFix a panic in the wifi stack when a software beacon miss occurs in the wrong state.
adrian [Sun, 2 Oct 2011 02:42:31 +0000 (02:42 +0000)]
Fix a panic in the wifi stack when a software beacon miss occurs in the wrong state.

The ieee80211_swbmiss() callout is not called with the ic lock held, so it's
quite possible the scheduler will run the callout during a state change.

This patch:

* changes the swbmiss callout to be locked by the ic lock
* enforces the ic lock being held across the beacon vap functions
  by grabbing it inside beacon_miss() and beacon_swmiss().

This ensures that the ic lock is held (and thus the VAP state
stays constant) during beacon miss and software miss processing.
Since the callout is removed whilst the ic lock is held, it also
ensures that the ic lock can't be called during a state change
or exhibit any race conditions seen above.

Both Edgar and Joel report that this patch fixes the crash and
doesn't introduce new issues.

Reported by: Edgar Martinez <emartinez@kbcnetworks.com>
Reported by: Joel Dahl <joel@vnode.se>
Reported by: emaste

12 years agoTweaks to ps(1):
gjb [Sat, 1 Oct 2011 23:47:37 +0000 (23:47 +0000)]
Tweaks to ps(1):
- there's no reason the semantics of the -x flag are being explained in
  the -a flag description
- be more precise regarding the relation between the -a flag and the
  security.bsd.see_other_uids sysctl
- describe the format of the -t flag's argument
- 'con' no longer is a possible entry in the 'TT' column
- explain that the 'TT' column refers to pseudo-terminals via mere numbers
- add a hint in the 'tt' keyword description that a keyword 'tty' exists,
  which will give the full terminal pathname

Submitted by: arundel (via docs@) (original)
MFC after: 1 week
With-MFC: 225908

12 years agoReorder default ps(1) output according to reality.
gjb [Sat, 1 Oct 2011 20:56:58 +0000 (20:56 +0000)]
Reorder default ps(1) output according to reality.

Submitted by: arundel (via docs@)
MFC after: 1 week

12 years agoShut up warnings with Cyrus SASL 2.1.25.
ume [Sat, 1 Oct 2011 18:20:10 +0000 (18:20 +0000)]
Shut up warnings with Cyrus SASL 2.1.25.

Spotted by: ache
Tested by: ache

12 years agoRemove obsolete macros.
marius [Sat, 1 Oct 2011 13:33:14 +0000 (13:33 +0000)]
Remove obsolete macros.

12 years agoNuke SUN4U #ifdef's which with the demise of sun4v no longer serve any
marius [Sat, 1 Oct 2011 13:16:01 +0000 (13:16 +0000)]
Nuke SUN4U #ifdef's which with the demise of sun4v no longer serve any
purpose.

12 years agoAlso allocate space for the PIL counters. Given that no machine actually
marius [Sat, 1 Oct 2011 13:11:29 +0000 (13:11 +0000)]
Also allocate space for the PIL counters. Given that no machine actually
uses IV_MAX interrupt vectors this wasn't a problem in practice though.

12 years agoReimplement ctermid().
ed [Sat, 1 Oct 2011 12:19:48 +0000 (12:19 +0000)]
Reimplement ctermid().

Even though POSIX allows us to return simply /dev/tty as a pathname
identifying the controlling terminal of the running process, it is nicer
if this function were actually useful, by returning the actual pathname
of the controlling terminal.

Implement ctermid() by using the kern.devname sysctl to resolve the
actual name of /dev/tty. Don't use devname(3), since it may return bogus
strings like #C:0x123.

12 years agoThe sigwait(3) function shall not return EINTR, according to the
kib [Sat, 1 Oct 2011 10:18:55 +0000 (10:18 +0000)]
The sigwait(3) function shall not return EINTR, according to the
POSIX/SUSvN. The sigwait(2) syscall does return EINTR, and libc.so.7
contains the wrapper sigwait(3) which hides EINTR from callers.  The
EINTR return is used by libthr to handle required cancellation point
in the sigwait(3).

To help the binaries linked against pre-libc.so.7, i.e. RELENG_6 and
earlier, to have right ABI for sigwait(3), transform EINTR return from
sigwait(2) into ERESTART.

Discussed with: davidxu
MFC after: 1 week

12 years agoCorrect column with for device numbers made in previous change.
ed [Sat, 1 Oct 2011 09:16:07 +0000 (09:16 +0000)]
Correct column with for device numbers made in previous change.

The device number should be displayed using only five columns -- not eight.

12 years agoDisable using wait in cpu_idle() until a better solution to timer and
adrian [Sat, 1 Oct 2011 05:56:25 +0000 (05:56 +0000)]
Disable using wait in cpu_idle() until a better solution to timer and
interrupt handling can be implemented.

12 years agoRe-reading the Schizo errata suggests that it's actually tolerable to
marius [Sat, 1 Oct 2011 00:31:30 +0000 (00:31 +0000)]
Re-reading the Schizo errata suggests that it's actually tolerable to
also use the streaming buffer of pre version 5/revision 2.3 hardware as
long as we stay away from context flushes (which iommu(4) so far doesn't
take advantage of). OpenSolaris does the same.

12 years ago- Add protective parentheses to macros as far as possible.
marius [Sat, 1 Oct 2011 00:22:24 +0000 (00:22 +0000)]
- Add protective parentheses to macros as far as possible.
- Move {r,w,}mb() to the top of this file where they live on most of the
  other architectures.

12 years agoIn total store which we use for running the kernel and all of the userland
marius [Sat, 1 Oct 2011 00:11:03 +0000 (00:11 +0000)]
In total store which we use for running the kernel and all of the userland
atomic operations behave as if the were followed by a memory barrier so
there's no need to include ones in the acquire variants of atomic(9).
Removing these results a small performance improvement, specifically this
is sufficient to compensate the performance loss seen in the worldstone
benchmark seen when using SCHED_ULE instead of SCHED_4BSD.
This change is inspired by Linux even more radically doing the equivalent
thing some time ago.
Thanks go to Peter Jeremy for additional testing.

12 years agoAdd a comment about why contrary to what once would think running all of
marius [Fri, 30 Sep 2011 20:23:18 +0000 (20:23 +0000)]
Add a comment about why contrary to what once would think running all of
userland with total store order actually is appropriate.

12 years agoUse the extended integer condition code when comparing 64-bit values. Given
marius [Fri, 30 Sep 2011 20:13:51 +0000 (20:13 +0000)]
Use the extended integer condition code when comparing 64-bit values. Given
that ATOMIC_INC_LONG currently is unused this happened to not be fatal.

12 years ago- Right-justify backslashes as suggested by style(9).
marius [Fri, 30 Sep 2011 20:06:23 +0000 (20:06 +0000)]
- Right-justify backslashes as suggested by style(9).
- Rename ATOMIC_INC_ULONG to ATOMIC_INC_LONG in order to be consistent with
  the names of the other macros in this file an adjust accordingly.

12 years agoFix an obvious bug from r186196 shadowing a variable, not correctly
bz [Fri, 30 Sep 2011 18:20:16 +0000 (18:20 +0000)]
Fix an obvious bug from r186196 shadowing a variable, not correctly
appending the new mbuf to the chain reference but possibly causing an mbuf
nextpkt loop leading to a memory used after handoff (or having been freed)
and leaking an mbuf here.

Reviewed by: rwatson, brooks
MFC after: 3 days

12 years agoFix a corner case in the HAL debugging changes, where ah was NULL.
adrian [Fri, 30 Sep 2011 05:17:57 +0000 (05:17 +0000)]
Fix a corner case in the HAL debugging changes, where ah was NULL.

Although I tried to fix this earlier by introducing HALDEBUG_G(), it
turns out there seem to be other cases where the pointer value is still
NULL.

* Fix DO_HALDEBUG() and the HALDEBUG macro to check whether ah is NULL
  before deferencing it
* Remove HALDEBUG_G() as it's no longer needed

This is hopefully a merge candidate for 9.0-RELEASE as enabling
debugging at startup could result in a kernel panic.

12 years agoRemove pointless semicolons after label
kevlo [Fri, 30 Sep 2011 04:55:23 +0000 (04:55 +0000)]
Remove pointless semicolons after label

12 years agoRevive the LLVM and Clang license files, which were removed in my
dim [Thu, 29 Sep 2011 18:12:40 +0000 (18:12 +0000)]
Revive the LLVM and Clang license files, which were removed in my
too-thorough cleanup of unused files, in r213695.  Also make sure these
get installed under /usr/share/doc.

Submitted by: rwatson, brooks
Pointy hat to: dim
MFC after: 3 days

12 years agoAdd Oxford Semiconductor OXPCIe952 (0x1c38) 1 port serial card.
ae [Thu, 29 Sep 2011 15:43:02 +0000 (15:43 +0000)]
Add Oxford Semiconductor OXPCIe952 (0x1c38) 1 port serial card.

PR: kern/160895
Submitted by: Konstantin V. Krotov
MFC after: 1 week

12 years agoAdd header missed in r225875.
mav [Thu, 29 Sep 2011 15:12:58 +0000 (15:12 +0000)]
Add header missed in r225875.

MFC after: 3 days

12 years agoHandle the race in cpu_idle() when due to the critical section CPU could get
mav [Thu, 29 Sep 2011 14:19:34 +0000 (14:19 +0000)]
Handle the race in cpu_idle() when due to the critical section CPU could get
into sleep after receiving interrupt, delaying interrupt thread execution
indefinitely until the next interrupt arrive.

Reviewed by: nwhitehorn
MFC after: 3 days

12 years ago - Add special support for the MFI_CMD ioctl with MFI_CMD_STP command, used
mav [Thu, 29 Sep 2011 08:37:53 +0000 (08:37 +0000)]
 - Add special support for the MFI_CMD ioctl with MFI_CMD_STP command, used
by present MegaCLI version. It has some special meaning for the first s/g
list entry, while the main s/g list begins from the the second entry, and
those lists should remain separate after loading to the busdma map.
 - Fix bug in 32bit ioctl compatibility shims when s/g list consists of
more then on element.

Sponsored by: iXsystems, inc.
MFC after: 3 days

12 years agoMake ps(1) automatically size its column widths.
trasz [Thu, 29 Sep 2011 06:31:42 +0000 (06:31 +0000)]
Make ps(1) automatically size its column widths.

12 years agoFix a confusing sentence. [1]
wblock [Thu, 29 Sep 2011 03:37:42 +0000 (03:37 +0000)]
Fix a confusing sentence. [1]
Other wording tweaks.

Reviewed by: imp [1]
Approved by: gjb

12 years agoWhitespace cleanup in build(7).
gjb [Thu, 29 Sep 2011 02:57:08 +0000 (02:57 +0000)]
Whitespace cleanup in build(7).

MFC after: 1 week
Need-MFC: 225858

12 years agoDocument, and provide an example for, PORTS_MODULES in build(7).
gjb [Thu, 29 Sep 2011 02:52:33 +0000 (02:52 +0000)]
Document, and provide an example for, PORTS_MODULES in build(7).

PR: 161017
Submitted by: gcooper
MFC after: 1 week

12 years agoFix a few grammar and mdoc nits in script.1
gjb [Thu, 29 Sep 2011 02:29:32 +0000 (02:29 +0000)]
Fix a few grammar and mdoc nits in script.1

PR: 161088
Submitted by: Ben Kaduk ( kaduk % mit ! edu )
MFC after: 1 week
Need-MFC: 225809

12 years agoStyle nit.
kib [Thu, 29 Sep 2011 00:44:34 +0000 (00:44 +0000)]
Style nit.

Submitted by: jhb
MFC after: 2 weeks

12 years ago- I am not the oldest committer alive (yet)
eadler [Wed, 28 Sep 2011 21:42:13 +0000 (21:42 +0000)]
- I am not the oldest committer alive (yet)

Approved by: bapt (mentor)

12 years ago- fix whitespace issue in calendar
eadler [Wed, 28 Sep 2011 20:46:52 +0000 (20:46 +0000)]
- fix whitespace issue in calendar
- add a n after \

Submitted by: brueffer
Approved by: bapt (mentor)

12 years agoBelatedly regenerate after application of the HPN patch.
des [Wed, 28 Sep 2011 20:42:22 +0000 (20:42 +0000)]
Belatedly regenerate after application of the HPN patch.

12 years agoTest if the interface is afif in dhcpif() and syncdhcpif(), as
delphij [Wed, 28 Sep 2011 19:01:15 +0000 (19:01 +0000)]
Test if the interface is afif in dhcpif() and syncdhcpif(), as
done in ipv6_autoconfif.

Reviewed by: hrs (freebsd-rc@)
MFC after: 1 week

12 years ago- add myself to committers-ports.dot
eadler [Wed, 28 Sep 2011 18:56:02 +0000 (18:56 +0000)]
- add myself to committers-ports.dot

Approved by: sahil (mentor)

12 years agoGet rid of major/minor number distinction.
ed [Wed, 28 Sep 2011 18:53:36 +0000 (18:53 +0000)]
Get rid of major/minor number distinction.

As of FreeBSD 6, devices can only be opened through devfs. These device
nodes don't have major and minor numbers anymore. The st_rdev field in
struct stat is simply based a copy of st_ino.

Simply display device numbers as hexadecimal, using "%#jx". This is
allowed by POSIX, since it explicitly states things like the following
(example taken from ls(1)):

"If the file is a character special or block special file, the
size of the file may be replaced with implementation-defined
information associated with the device in question."

This makes the output of these commands more compact. For example, ls(1)
now uses approximately four columns less. While there, simplify the
column length calculation from ls(1) by calling snprintf() with a NULL
buffer.

Don't be afraid; if needed one can still obtain individual major/minor
numbers using stat(1).

12 years ago- add myself to calendar
eadler [Wed, 28 Sep 2011 18:49:37 +0000 (18:49 +0000)]
- add myself to calendar

Approved by: sahil (mentor)

12 years agoSync RCS id with NetBSD, this was intentionally omitted from the advisory
delphij [Wed, 28 Sep 2011 18:03:53 +0000 (18:03 +0000)]
Sync RCS id with NetBSD, this was intentionally omitted from the advisory
in order to reduce patchset size.

MFC after: 3 days