rwatson [Tue, 8 May 2007 10:16:23 +0000 (10:16 +0000)]
Merge uipc_usrreq.c:1.178,1.192 from HEAD to RELENG_6:
Add two new unpcb flags, UNP_BINDING and UNP_CONNECTING, which will be
used to mark UNIX domain sockets as being in the process of binding or
connecting. Use these to prevent simultaneous bind or connect
operations by multiple threads or processes on the same socket at the
same time, which closes race conditions present in the UNIX domain
socket implementation since inception.
Set UNP_CONNECTING when committing to moving ahead in unp_connect().
This logic was lost when merging the remainder of these changes in
1.178.
rwatson [Tue, 8 May 2007 08:32:29 +0000 (08:32 +0000)]
Merge uipc_usrreq.c:1.171 from HEAD to RELENG_6:
Reduce periods of simultaneous acquisition of various socket buffer
locks and the unplock during uipc_rcvd() and uipc_send() by caching
certain values from one structure while its locks are held, and
applying them to a second structure while its locks are held. If
done carefully, this should be correct, and will reduce the amount
of work done with the global unp lock held.
simokawa [Mon, 7 May 2007 08:00:21 +0000 (08:00 +0000)]
MFC:
- Simplify tlabel handling.
- Remove unused fw_asybusy().
- Add a sysctl knob to disable cycle master mode and add some comments.
- Fix broken userland API for async packets.
- Fix typo in recv spd.
- Update state in fw_xferq_dorain() after removed from the send queue.
- Remove unnecessary 'goto err;".
- Improve asynchronous packet receive process.
alc [Sun, 6 May 2007 00:34:43 +0000 (00:34 +0000)]
MFC Revision 1.538:
Remove stale KSE code.
MFC Revision 1.551:
In general, bits in the page directory entry (PDE) and the page table
entry (PTE) have the same meaning. The exception to this rule is the
eighth bit (0x080). It is the PS bit in a PDE and the PAT bit in a
PTE. This change avoids the possibility that pmap_enter() confuses a
PAT bit with a PS bit, avoiding a panic().
Eliminate a diagnostic printf() from the i386 pmap_enter() that serves
no current purpose.
MFC Revision 1.559:
Eliminate a comment that became stale after revision 1.540.
MFC Revision 1.575:
Finish the PG_NX support at the pmap level.
MFC Revision 1.582:
Eliminate the misuse of PG_FRAME to truncate a virtual address
to a virtual page boundary.
alc [Sat, 5 May 2007 21:13:16 +0000 (21:13 +0000)]
MFC
Acquiring smp_ipi_mtx on every call to pmap_invalidate_*() is wasteful.
For example, during a buildworld more than half of the calls do not
generate an IPI because the only TLB entry invalidated is on the calling
processor. This revision pushes down the acquisition and release of
smp_ipi_mtx into smp_tlb_shootdown() and smp_targeted_tlb_shootdown() and
instead uses sched_pin() and sched_unpin() in pmap_invalidate_*() so that
thread migration doesn't lead to a missed TLB invalidation.
Use pmap_try_insert_pv_entry() in pmap_copy() instead of
pmap_insert_entry().
Eliminate the explicit low-memory checks in pmap_copy().
MFC Revision 1.544
Retire pmap_track_modified().
MFC Revision 1.555
Introduce the function pmap_enter_object().
MFC Revision 1.558 (in part)
Change pmap_enter_quick_locked() to fail rather than wait if it is
unable to allocate a page table page. Similarly, change
pmap_enter_quick_locked() to call pmap_try_insert_pv_entry() rather
than pmap_insert_entry().
Add an assertion that the object containing m_start is locked in
pmap_enter_object(). Remove a similar assertion from
pmap_enter_quick_locked() because that function no longer accesses
the containing object.
sobomax [Thu, 3 May 2007 11:13:58 +0000 (11:13 +0000)]
MFC: Implement 32 bit getcontext/setcontext/swapcontext on amd64. Still
stubs for ia64 to keep it compiling. These are used by 32 bit apps such
as gdb.
yar [Thu, 3 May 2007 09:56:51 +0000 (09:56 +0000)]
MFC rev. 1.32:
Fix a typo: argv -> argvp.
Rationale:
We are interested in the current (last) element of the argv array
there, not in its first element. [...]
Also add a comment that the argv array ends up null-terminated in
any case (it's due to the design of the for loop) as an answer to
a possible question why the whole argv isn't zero-filled.
thomas [Thu, 3 May 2007 09:38:54 +0000 (09:38 +0000)]
MFC rev. 1.52:
(atapi_cb): Fix test for the presence of sense data. An incorrect condition
was being tested, which would result in a system hang in some configurations.
jhb [Wed, 2 May 2007 18:42:47 +0000 (18:42 +0000)]
MFC: Initial PAT support including the following:
- New pmap_mapdev_attr() function for amd64 and i386.
- pmap_mapdev() on i386 and amd64 uses UC now rather than WB.
- New pmap_mapbios()/pmap_unmapbios() functions to map firmware tables.
- New pmap_change_attr() function for amd64 and i386.
- Bump __FreeBSD_version.
marius [Tue, 1 May 2007 13:31:33 +0000 (13:31 +0000)]
MFC: psycho.c 1.61; psychoreg.h 1.12
o Changes to psycho_attach(): [1]
- Clear the PCI AFSR and status error bits as previous errors still
might be indicated.
- Set up the PCI control and diagnostic registers according to the
capabilities, workarounds, etc of/for specific revisions of the
supported bridges. This includes no longer setting Hummingbird-/
Sabre-specific bits in the PCI control register but preserving
what the firmware has initialized them to like OpenSolaris does.
Previously we were setting these bits according to the example in
the Sabre documentation, which I doubt is appropriate for all
Sabre based designs and especially not for Hummingbirds. This
also includes not enabling bus parking unless the firmware tells
us to.
- Set the PCI latency timer register as this isn't always done by
the firmware.
o Remove a redundant argument from psycho_set_intr() and in this
function check the return value of bus_setup_intr(). [2]
o Let psycho_setup_intr() return ENOMEM instead of 0 when it can't
allocate memory for the interrupt wrapper stub and EINVAL instead
of 0 if it can't find the interrupt vector in the interrupt map.
o Add a workaround for a bug of the Sabre-APB-combination where it
doesn't drain DMA write data for devices behind additional PCI-PCI
bridges underneath the APB PCI-PCI bridge. This workaround (do
things necessary in order to achieve a manual drain when coherency
is required) is currently implemented in psycho_setup_intr() and
psycho_intr_stub() due to lack of a real BUS_GET_DMA_TAG() and
psycho(4)-specific bus_dma_tag_create() and bus_dmamap_sync()
methods, respectively, in RELENG_6 and therefore is only applied
for interrupt handlers but not for polling(4) callbacks. [3]
o Fix some minor style issues.
Info from: OpenSolaris [1]
Info from: Linux, OpenBSD, OpenSolaris [3]
Suggested by: Coverity Prevent (CID 682) [2]
MFC: Various fixes to cpu_reset_real()
- Try to use the reset control register (I/O port 0xcf9) and the fast a20
and init register (I/O port 0x92) if the keyboard reset fails.
- Fix the triple fault to actually work when PGE is enabled.
Modified release notes:
- ncurses was updated from version 5.2-20020615
- MSI-X supported as well, remove ref to pci(4) manpage, which is
different from the kernel's PCI code
- Patch for AD1981B codec to enable (automuting) headphone jack sense.
- Enable tone / 3D controls for YAMAHA YMF743, 753 and 752 (partially) [1]
- AC97 quirk / patch cleanups. Most quirks doesn't work in general sense
and should only be applied on certain specific card / vendor, hence the
addition of ac97_getsubvendor(). [2]
- Fix low volume issue on several MSI laptops through ALC655 quirk. [2]
In account management, verify whether the account has been locked
with `pw lock', so that it's impossible to log into a locked account
using an alternative authentication mechanism, such as an ssh key.
This change affects only accounts locked with pw(8), i.e., having a
`*LOCKED*' prefix in their password hash field, so people still can
use a different pattern to disable password authentication only.
Mention all account management criteria in the manpage.
MFC bridgestp.c r1.35-36, bridgestp.h r1.13, if_bridge.c r1.94-95
- Change the passing of callbacks to a struct in case this needs to be
extended in the future.
- Properly move the setting of bstp_linkstate_p to the bridgestp module.
MFC if_re.c, rev. 1.89 if_rlreg.h, rev 1.65 to RELENG_6.
Don't reinitialize the hardware if only PROMISC flag was changed.
Previously whenever PROMISC mode turned on/off link renegotiation
occurs and it could resulted in network unavailability for serveral
seconds.(Depending on switch STP settings it could last several tens
seconds.)
MFC: Don't hold the vnode interlock across a tsleep() in nfs_flush().
This was actually contained in the MPSAFE NFS client changes which is not
all being MFC'd, however, this fixes a bug in the previous fix to
nfs_flush().
MFC:
- In nfs_flush(), clear the NMODIFIED bit only if there are no dirty
buffers *and* there are no buffers queued up for writing.
- Keep track of the number of in-progress async direct IO writes in the
nfsnode. Make fsync/close wait until all of these drain. Add a check to
nfs_getpage() and nfs_putpage().
MFC:
Invalidate all TLBs and page structure caches that may reference a page
for page walk acceleration before releasing it to the free list.
This is required for CPUs implementing page structure caches as described
in the Intel application note:
"TLBs, Paging-Structure Caches, and Their Invalidation"
(Document Number: 317080-001)
Add a new sysctl net.inet.ip6.rthdr0_allowed, which is default off,
to disable the processing of Route Header Type 0 options in IPv6.
This is not really an MFC because currently in HEAD the processing
of these options is disabled unilateraly pending discussion at the IETF
on the future of such headers.
MFC rev. 1.208:
When LK_NOWAIT is passed as argument to process_worklist_item(), this
does not prevent handle_workitem_remove() from recursing into a blocking
version. Add the dirrem to worklist instead of processing it now if this
is the case.
MFC rev. 1.209:
Recalculate the NEWBLOCK flag for pagedep structure after the softdep
lock is dropped, since pagedep may be already processed and deallocated.
MFC: Don't go to a whole lot of extra work to handle the race where the
new file descriptor is closed out from under us in kern_open(). This race
is already handled and the file will be closed when kern_open() does an
fdrop just before returning.
In addition, by handling the race early, this opens the code up to an
obscure bug where opening a devfs file could replace f_ops in the file
object so that fdrop() will try to close the vnode, but f_vnode never gets
set, so the vnode close routine panics due to the NULL f_vnode.
Shorten text string for ip_fw2 dynamic rules zone by removing the word
"zone", which is generally not present in zone names. This reduces the
incidence of line-wrapping in "vmstat -z " using 80-column displays.
Include a note in the sendmail 8.14.1 release note regarding the libmilter
update. Unfortunately, this problem (the need to recompile filters) was
found after the MFC. The release engineering team has asked for this
instead of doing a full backout of sendmail 8.14 in the RELENG_[456]
branches.
Don't forget to close the range if we branched over its end
and had no chance to match it by the 2nd address precisely.
Otherwise the unclosed range would bogusly extend to the end
of stream.
Add missing newline to correct failure of the regression test.
According to IEEE Std 1003.1, 2004 "Whenever the pattern space is
written to standard output or a named file, sed shall immediately
follow it with a <newline>."