Commit Graph

74116 Commits

Author SHA1 Message Date
John Baldwin
983998573b MFC 197649:
Do not hold the ACPI A/C adapter lock when changing the power profile.
2009-10-29 15:28:05 +00:00
John Baldwin
9ad4b9fbd2 MFC 197648:
Split the 'video' ACPI lock up into two locks to resolve a LOR with the
sysctl lock.  The 'video' lock now protects the 'bus' of video output
devices attached to a graphics adapter.  It is used when iterating over
the list of outputs, etc.  The 'video_output' lock is used to lock the
output-specific data similar to a driver lock for the individual video
outputs.
2009-10-29 15:24:57 +00:00
John Baldwin
9e14139d9b MFC 196840:
Fill the reverse RSS map with 0xff's so that the subsequent loop to
calculate the values will work properly.
2009-10-29 15:17:59 +00:00
John Baldwin
50d356311a MFC 197460:
Remove unnecessary locking from attach().  This fixes a LOR between the
acpi_ibm lock and the sysctl lock.
2009-10-29 15:13:36 +00:00
John Baldwin
a6fb726860 MFC 196615:
Extend the device pager to support different memory attributes on different
pages in an object.
- Add a new variant of d_mmap() currently called d_mmap2() which accepts
  an additional in/out parameter that is the memory attribute to use for
  the requested page.
- A driver either uses d_mmap() or d_mmap2() for all requests but not both.
  The current implementation uses a flag in the cdevsw (D_MMAP2) to indicate
  that the driver provides a d_mmap2() handler instead of d_mmap().  This
  is done to make the change ABI compatible with existing drivers and
  MFC'able to 7 and 8.
2009-10-29 15:09:54 +00:00
Alexander Motin
f39d3da87e MFC rev. 198487:
Round timeout up when converting CAM milliseconds to ATA seconds.
2009-10-29 10:38:17 +00:00
Alexander Motin
963069c15e MFC rev. 198488:
Report SATA speeds to CAM, to not confuse users with low numbers logged.
2009-10-29 10:35:50 +00:00
Alexander Motin
e180821780 MFC rev. 198481, 198482:
Add two more VIA SATA chip IDs.

PR:		kern/135057
2009-10-29 10:05:08 +00:00
Alexander Motin
6b7a5f803b MFC rev. 198480, 198483:
Document new modularised ATA kernel modules and options.

PR:             kern/133162, amd64/139859
2009-10-29 09:58:16 +00:00
Alexander Motin
9149cb69ab Fix SATA on nVidia MCP55 chipset. It needs some short time to allow BAR(5)
memory access.

PR:		amd64/128686, amd64/132372, amd64/139156
2009-10-29 09:45:48 +00:00
Qing Li
f60909e3e2 MFC r198418
Use the correct option name in the preprocessor command to enable
or disable diagnostic messages.

Reviewed by:	ru
2009-10-28 21:45:25 +00:00
Qing Li
54b7653bd5 MFC r198353
Verify "smp_started" is true before calling
sched_bind() and sched_unbind().

Reviewed by:	kmacy
2009-10-28 21:43:16 +00:00
Ken Smith
1e5dd50780 Prepare for 8.0-RC2 builds.
Approved by:	re (implicit)
2009-10-25 00:28:01 +00:00
Ruslan Ermilov
f47552e770 MFC r198295:
Random number generator initialization cleanup:

- Introduce new SI_SUB_RANDOM point in boot sequence to make it
clear from where one may start using random(9).  It should be as
early as possible, so place it just after SI_SUB_CPU where we
have some randomness on most platforms via get_cyclecount().

- Move stack protector initialization to be after SI_SUB_RANDOM
as before this point we have no randomness at all.  This fixes
stack protector to actually protect stack with some random guard
value instead of a well-known one.

Note that this patch doesn't try to address arc4random(9) issues.
With current code, it will be implicitly seeded by stack protector
and hence will get the same entropy as random(9).  It will be
securely reseeded once /dev/random is feeded by some entropy from
userland.

Submitted by:	Maxim Dounin <mdounin@mdounin.ru>
Approved by:	re (kib)
2009-10-24 04:55:14 +00:00
John Baldwin
115753ce9e MFC 198174:
Close a race with caching of -ve name lookups in the NFS client.
Specifically, clients only trust -ve cache entries while the directory
remains unchanged and discard any -ve cache entries for a directory when
they notice that the modification time of a directory entry changes.  The
race involves two concurrent lookups as follows:
- Thread A does a lookup for file 'foo' which sends a lookup RPC to the
  server.  The lookup fails and the server replies.
- The 'foo' file is created (either by the same client or a different
  client) updating the modification time on the parent directory of 'foo'.
- Thread B does a lookup for a different file 'bar' which updates the
  cached attributes of the parent directory of 'foo' to reflect the new
  modification time after 'foo' was created.
- Thread A finally resumes execution to parse the reply from the NFS
  server.  It adds a -ve cache entry and sets the cached value of the
  directory's modification time that is used for invalidating -ve cached
  lookups to the new modification time set by thread B.

At this point, future lookups of 'foo' will honor the -ve cached entry
until the cached entry is pushed out of the name cache's LRU or the
modification time of the parent directory is changed again by some other
change.  The fix is to read the directory's modification time before
sending the lookup RPC and use that cached modification time when setting
the directory's cached modification time.  Also, we do not add a -ve cache
entry if another thread has added -ve cache entry that set the directory's
cached modification time to a newer value than the value we read before
sending the lookup RPC.

Approved by:	re (kib)
2009-10-23 19:52:29 +00:00
Qing Li
dbd4bfe317 MFC 198306
The flow-table function flowtable_route_flush() may be called
during system initialization time. Since the flow-table is
designed to maintain per CPU flow cache, the existing code
did not check whether "smp_started" is true before calling
sched_bind() and sched_unbind(), which triggers a page fault.

Reviewed by:	jeff
Approved by:	re
2009-10-22 18:48:25 +00:00
Edward Tomasz Napierala
1c7deea437 MFC r196863:
Improve wording.

MFC r196941:

Prevent the line from wrapping.

Approved by:	re (kib)
2009-10-22 16:26:38 +00:00
Andrew Thompson
b1c3c31d58 MFC r198307
Change from CAM_TID_INVALID to CAM_SEL_TIMEOUT error code when the usb device
 has been yanked, this works around a cam recounting bug when
 CAM_DEV_UNCONFIGURED is set late in the detach. In certain conditions the
 reference to the XPT device would not be released which would cause the usb
 explore thread to sleep forever on "simfree", preventing any new usb devices to
 be found/ejected on the bus.

Approved by:	re (kib)
2009-10-21 19:48:27 +00:00
Konstantin Belousov
46aaa1ed67 MFC r198201:
Remove spurious call to priv_check(PRIV_VM_SWAP_NOQUOTA).
Call priv_check(PRIV_VM_SWAP_NORLIMIT) only when per-uid limit is
actually exceed.

Approved by:	re (kensmith)
2009-10-21 15:07:34 +00:00
Robert Watson
cbdd92bda4 Merge r198233 from head to stable/8:
Clean up comments, white space, and style in pfil.c (VNET changes not
  MFC'd)

Approved by:	re (kib)
2009-10-21 14:05:51 +00:00
Robert Watson
5e2ef9933c Merge r198198 from head to stable/8:
Line-wrap pfil.c so that it prints more nicely.

Approved by:	re (kensmith)
2009-10-21 13:11:38 +00:00
Robert Watson
304762b138 Merge r198219 from head to stable/8:
Remove unused pfil_flags field in packet_filter_hook.

Approved by:	re (kib)
2009-10-21 09:53:55 +00:00
Qing Li
0eb4d28bac MFC 198301
In the ARP callout timer expiration function, the current time_second
is compared against the entry expiration time value (that was set based
on time_second) to check if the current time is larger than the set
expiration time. Due to the +/- timer granularity value, the comparison
returns false, causing the alternative code to be executed. The
alternative code path freed the memory without removing that entry
from the table list, causing a use-after-free bug.

Reviewed by:	discussed with kmacy
Approved by:	re
Verified by:	rnoland, yongari
2009-10-20 21:36:56 +00:00
Robert Watson
752b1b6971 Merge r198218 from head to stable/8:
Sort function prototypes in pfil.h, clean up white space, and better
  align fields for printing.

Approved by:	re (kensmith)
2009-10-20 18:54:51 +00:00
Weongyo Jeong
6fb7173c2b MFC r198098:
fixes a TX hang bug that it could happen when if_start callback didn't
  be restarted by full of the output queue.

  Tested by:      bsduser <bsd at acd.homelinux.org>

MFC r198099:
  fixes a TX hang that could be possible to happen when the trasfers are
  in the high speed that some drivers don't call if_start callback after
  marking ~IFF_DRV_OACTIVE.

Approved by:	re (kib)
2009-10-20 17:50:36 +00:00
Qing Li
6f99a646e4 MFC r198111
This patch fixes the following issues in the ARP operation:

1. There is a regression issue in the ARP code. The incomplete
   ARP entry was timing out too quickly (1 second timeout), as
   such, a new entry is created each time arpresolve() is called.
   Therefore the maximum attempts made is always 1. Consequently
   the error code returned to the application is always 0.
2. Set the expiration of each incomplete entry to a 20-second
   lifetime.
3. Return "incomplete" entries to the application.
4. The return error code was incorrect.

Reviewed by:	kmacy
Approved by:	re
2009-10-20 17:44:50 +00:00
Stanislav Sedov
ea95296ce8 - Disable ASF by default in STABLE_8. This causes a lot
of problems on non-DELL branded machines with IPMI
  support.  The proposed fix was committed to HEAD but has
  not received much test coverage yet.

Discussed with:	bz
Approved by:	re (kensmith)
2009-10-20 16:41:23 +00:00
Robert Watson
92b52ada7c Merge r198196 from head to stable/8:
Rewrap ip_input() comment so that it prints more nicely.

Approved by:	re (kib)
2009-10-20 16:22:31 +00:00
Konstantin Belousov
dc68cec603 MFC r197934:
Map PIE binaries at non-zero base address.

MFC r198202:
Honour non-zero mapbase for PIE binaries. Inform interpreter-less PIE
binary about its relocbase.

Approved by:	re (kensmith)
2009-10-20 13:34:41 +00:00
Konstantin Belousov
55f128de91 MFC r197933:
Define architectural load bases for PIE binaries.

MFC r198203 (by marius):
Change load base for sparc to match default gcc memory layout model.

Approved by:	re (kensmith)
2009-10-20 13:32:28 +00:00
Konstantin Belousov
5b15472fe9 MFC r197932:
Do not map elf segments of zero length.

Approved by:	re (kensmith)
2009-10-20 13:30:06 +00:00
John Baldwin
74fb2c91c6 MFC 198126:
Fix a sign bug in the handling of nice priorities when computing the
interactive score for a thread.

Approved by:	re (kib)
2009-10-19 19:40:05 +00:00
John Baldwin
a9266569b7 MFC 198079:
Use zfs_read() instead of xfsread() to read /boot.config.  xfsread() fails
short read requests, so the result was that a /boot.config smaller than 512
bytes was ignored.  boot2 uses fsread() instead of xfsread() to read
/boot.config already, so this makes zfsboot more like boot2.

Approved by:	re (kib)
2009-10-19 18:31:39 +00:00
Rui Paulo
596646aee5 MFC 197975, 197977, 197980, 198027:
Update for latest 802.11s changes in meshconf format.

Approved by:	re (kib)
2009-10-17 13:42:23 +00:00
Robert Watson
0dcda942fd Add a MODULE_DEPEND() on the NFS client from dtnfsclient so that dtnfsclient
can access NFS client symbols.

Discussed with:	kib
Reported by:	markm
Approved by:	re (kib)
2009-10-15 14:39:59 +00:00
Michael Tuexen
bef10df88e MFC r197868.
Use correct arguments when calling SCTP_RTALLOC().
Approved by: re, rrs (mentor)
2009-10-14 17:26:05 +00:00
Ermal Luçi
d8e86c4a5d Fix typo which has survived amazingly long!
Reviewed by:	mlaier(mentor)
Approved by:	re(kib)
2009-10-14 15:32:46 +00:00
Attilio Rao
be0ac16015 MFC r197476:
In function do_rw_wrlock, when a writer got an error and before returning,
check if there are readers blocked by us via URWLOCK_WRITE_WAITERS flag,
and resume the readers. The error must be EAGAIN, otherwise there must
have memory problem, and nobody can rescue the buggy application.

Approved by:	re (kib), davidxu
2009-10-13 13:03:31 +00:00
Konstantin Belousov
aba70b5e59 MFC r197942:
Refine r195509, instead of checking that vnode type is VBAD, that is
set quite late in the revocation path, properly verify that vnode is
not doomed before calling VOP.

Approved by:	re (bz)
2009-10-13 09:24:51 +00:00
Pawel Jakub Dawidek
69882ff11d MFC r197898:
If provider is open for writing when we taste it, skip it for classes that
depend on on-disk metadata. This was we won't attach to providers that are used
by other classes. For example we don't want to configure partitions on da0 if
it is part of gmirror, what we really want is partitions on mirror/foo.

During regular work it works like this: if provider is open for writing a class
receives the spoiled event from GEOM and detaches, once provider is closed the
taste event is send again and class can rediscover its metadata if it is still
there.  This doesn't work that way when new class arrives, because GEOM gives
all existing providers for it to taste, also those open for writing. Classes
have to decided on their own if they want to deal with such providers (eg.
geom_dev) or not (classes modified by this commit).

Reported by:	des, Oliver Lehmann <lehmann@ans-netz.de>
Tested by:	des, Oliver Lehmann <lehmann@ans-netz.de>
Discussed with:	phk, marcel
Reviewed by:	marcel
Approved by:	re (kib)
2009-10-12 21:08:06 +00:00
Pawel Jakub Dawidek
1d93d2aa4f MFC r197896:
Export disk serial numbers for adaX disks.

Reviewed by:	mav
Approved by:	re (kib)
2009-10-12 21:03:07 +00:00
Pawel Jakub Dawidek
d1c95b4a34 MFC r197831,r197842,r197843,r197860,r197861:
r197831:

Fix situation where Mac OS X NFS client creates a file and when it tries
to set ownership and mode in the same setattr operation, the mode was
overwritten by secpolicy_vnode_setattr().

PR:	kern/118320
Submitted by:	Mark Thompson <info-gentoo@mark.thompson.bz>

r197842:

Fix white-spaces.

r197843:

On FreeBSD it is enough to report provider removal when orphan event is
received, we don't have to do it on every ENXIO error in I/O path.
Solaris has no GEOM so they have to handle it in a less clean way.

r197860:

File system owner is when uid matches and jail matches.

r197861:

Allow file system owner to modify system flags if securelevel permits.

Approved by:	re (kib)
2009-10-12 20:36:55 +00:00
Attilio Rao
4dc32a7398 MFC r197803, r197824, r197910:
Per their definition, atomic instructions used in conjuction with
memory barriers should also ensure that the compiler doesn't reorder paths
where they are used.  GCC, however, does that aggressively, even in
presence of volatile operands.  The most reliable way GCC offers for avoid
instructions reordering is clobbering "memory".
Not all our memory barriers, right now, clobber memory for GCC-like
compilers.
Fix these cases.

Approved by:	re (kib)
2009-10-12 16:05:31 +00:00
Attilio Rao
3f4609ac69 MFC r197643, r197735:
When releasing a read/shared lock we need to use a write memory barrier
in order to avoid, on architectures which doesn't have strong ordered
writes, CPU instructions reordering.

Approved by:	re (kib)
2009-10-12 15:32:00 +00:00
Marcel Moolenaar
879632020a MFC change 197721:
Fix RTS/CTS flow control, broken by the TTY overhaul.  The new TTY
interface is fairly simple WRT dealing with flow control, but
needed 2 new RX buffer functions with "get-char-from-buf" separated
from "advance-buf-pointer" so that the pointer could be advanced
only when ttydisc_rint() succeeded.

Approved by:	re (kib)
2009-10-10 18:24:54 +00:00
Robert Watson
3e5cbaa4c7 Merge r197814 from head to stable/8:
Remove tcp_input lock statistics; these are intended for debugging only
  and are not intended to ship in 8.0 as they dirty additional cache
  lines in a performance-critical per-packet path.

Approved by:	re (kib, bz)
2009-10-09 09:18:22 +00:00
Bjoern A. Zeeb
67f0b21fa6 MFC r197727:
Put #ifdef INET around parts of the FLOWTABLE code, to unbreak
  nooptions INET kernel builds.

Approved by:	re (kib)
2009-10-08 20:58:09 +00:00
Konstantin Belousov
88c45ef724 MFC r197662:
Do not dereference vp->v_mount without holding vnode lock and checking
that the vnode is not reclaimed.

Approved by:	re (bz)
2009-10-08 11:28:32 +00:00
Robert Watson
f41dd6dca9 Merge r197795 from head to stable/8:
In tcp_input(), we acquire a global write lock at first only if a
  segment is likely to trigger a TCP state change (i.e., FIN/RST/SYN).
  If we later have to upgrade the lock, we acquire an inpcb reference
  and drop both global/inpcb locks before reacquiring in-order.  In
  that gap, the connection may transition into TIMEWAIT, so we need
  to loop back and reevaluate the inpcb after relocking.

  Reported by:        Kamigishi Rei <spambox at haruhiism.net>
  Reviewed by:        bz

Approved by:	re (kib)
2009-10-08 11:07:15 +00:00
Yoshihiro Takahashi
8fe1fb2047 MFC: revision 197730
unifdef NFSCLIENT because the nlm depends on the nfsclient even if NFSCLIENT
  is not defined.

  Now the nfslockd module works with the nfsclient module.

  Reviewed by:	kib

Approved by:	re (kensmith)
2009-10-07 14:14:05 +00:00