thompsa [Thu, 29 Oct 2009 23:25:52 +0000 (23:25 +0000)]
MFC r198151
Workaround buggy BIOS code in USB regard. By doing the BIOS to OS handover for
all host controllers at the same time, we avoid problems where the BIOS will
actually write to the USB registers of all the USB host controllers every time
we handover one of them, and consequently reset the OS programmed values.
thompsa [Thu, 29 Oct 2009 23:25:13 +0000 (23:25 +0000)]
MFC r197999 (hrs)
Fix the 106/109 USB Japanese keyboard "underscore" issue.
Sun Type 6 USB keyboard support added in rev 1.46 conflicted with
some scan codes used in Japanese keyboards because the scan code
conversion routine was ambiguous for the overlapped codes.
thompsa [Thu, 29 Oct 2009 23:18:59 +0000 (23:18 +0000)]
MFC r197562
Add extra safety locking when clobbering xfer->flags_int.started in start and
stop functions, because xfer->flags_int is also updated by the USB controller,
under the controller lock.
thompsa [Thu, 29 Oct 2009 23:10:11 +0000 (23:10 +0000)]
MFC r196491
We used force all of the GPIO pins low first and then
enable the ones we want. This has been changed to better
match the ADMtek's reference design to avoid setting the
power-down configuration line of the PHY at the same time
it is reset.
thompsa [Thu, 29 Oct 2009 23:09:37 +0000 (23:09 +0000)]
MFC r196490
- FIFO's are always opened separately in read and write direction even if the
actual device is opened for read and write. Fix fflags check so that the UFM
and URIO drivers work.
jilles [Thu, 29 Oct 2009 21:25:16 +0000 (21:25 +0000)]
MFC r197363: Update find(1) man page for -L/-delete interaction.
It is a bit unfortunate that the example to delete broken symlinks now uses
rm(1), but allowing this with -delete would require fixing fts(3) to not
imply FTS_NOCHDIR if FTS_LOGICAL is given (or hacks in the -delete option).
jhb [Thu, 29 Oct 2009 16:00:27 +0000 (16:00 +0000)]
MFC 197439:
Extract the code to find and map the MADT ACPI table during early kernel
startup and genericize it so it can be reused to map other tables as well:
- Add a routine to walk a list of ACPI subtables such as those used in the
APIC and SRAT tables in the MI acpi(4) driver.
- Move the routines for mapping and unmapping an ACPI table as well as
mapping the RSDT or XSDT and searching for a table with a given signature
out into acpica_machdep.c for both amd64 and i386.
jhb [Thu, 29 Oct 2009 15:24:57 +0000 (15:24 +0000)]
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.
jhb [Thu, 29 Oct 2009 15:09:54 +0000 (15:09 +0000)]
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.
jhb [Thu, 29 Oct 2009 14:40:21 +0000 (14:40 +0000)]
MFC 196555:
- Use the headers from ACPI-CA to define various constants and structures
for table layouts, etc. rather than homerolling our own structures and
constants in acpidump.h.
- Verify the extended checksum on the RSDP.
- Handle new ACPI 3.0 fields in MADT including X2APIC entries and
UIDs for local SAPICs.
- Add handling for new ACPI 3.0 flags in the FADT.
edwin [Wed, 28 Oct 2009 21:07:42 +0000 (21:07 +0000)]
MFC of r197597, r198270, r198515:
MFC of tzdata2009n:
- Pakistan will go out DST on 1 October.
- Headsup for changes in Argentina.
MFC of tzdata2009o:
- Somoa has not moved to DST this year (comment only)
- Bangladesh stays on DST for now.
- Pakistan went back to standard time in 1 October 2009
MFC of tzdata2009p:
- Argentina does not go to DST this year.
ru [Sat, 24 Oct 2009 04:55:14 +0000 (04:55 +0000)]
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)
jhb [Fri, 23 Oct 2009 19:52:29 +0000 (19:52 +0000)]
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.
philip [Fri, 23 Oct 2009 14:43:17 +0000 (14:43 +0000)]
MFC r198352
Make dhclient use bootpc (68) as the source port for unicast
DHCPREQUEST packets instead of allowing the protocol stack to pick
a random source port.
This fixes the behaviour where dhclient would never transition
from RENEWING to BOUND without going through REBINDING in networks
which are paranoid about DHCP spoofing, such as most mainstream
cable-broadband ISP networks.
Obtained from: OpenBSD
Reviewed by: brooks
Approved by: re (kib)
qingli [Thu, 22 Oct 2009 18:48:25 +0000 (18:48 +0000)]
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.
brueffer [Thu, 22 Oct 2009 08:34:20 +0000 (08:34 +0000)]
MFC: r198232
Powercrypt and NetSec seem to be defunct (webpages point to link farms
and a google search yields no alternative). Remove the links but
keep the entries around for reference.
thompsa [Wed, 21 Oct 2009 19:48:27 +0000 (19:48 +0000)]
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.
kib [Wed, 21 Oct 2009 15:07:34 +0000 (15:07 +0000)]
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.
qingli [Tue, 20 Oct 2009 21:36:56 +0000 (21:36 +0000)]
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
kan [Tue, 20 Oct 2009 19:05:43 +0000 (19:05 +0000)]
MFC Revision 197277:
Make libc.a provide __stack_chk_fail_local weak alias. This is
needed to satisfy static libraries that are compiled with -fpic
and linked into static binary afterwards. Several libraries in
gcc are examples of such static libs.
weongyo [Tue, 20 Oct 2009 17:50:36 +0000 (17:50 +0000)]
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.
qingli [Tue, 20 Oct 2009 17:44:50 +0000 (17:44 +0000)]
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.
stas [Tue, 20 Oct 2009 16:41:23 +0000 (16:41 +0000)]
- 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.
jhb [Mon, 19 Oct 2009 18:31:39 +0000 (18:31 +0000)]
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.
rwatson [Sun, 18 Oct 2009 15:58:57 +0000 (15:58 +0000)]
Merge r198118 from head to stable/8:
Print routing statistics as unsigned short rather than unsigned int,
otherwise sign extension leads to unlikely values when in the negative
range of the signed short structure fields that hold the statistics.
The type used to hold routing statistics is arguably also incorrect.
bland [Fri, 16 Oct 2009 09:29:06 +0000 (09:29 +0000)]
MFC r197995, 198020:
Link GSS mechanics modules against libgssapi so they will not fail due
unresolved symbol errors when in turn libgssapi was loaded with RTLD_LOCAL
flag set (which is the default).
dougb [Fri, 16 Oct 2009 00:17:09 +0000 (00:17 +0000)]
MFC r197947:
In regards to the "Starting foo:" type messages at boot time, create
and employ a more generic solution, and use it in the individual rc.d
scripts that also have an $rc_quiet test:
1. Add check_startmsgs() to rc.subr.
2. In the rc.d scripts that use rc_quiet (and rc.subr) substitute
variations of [ -z "$rc_quiet" ] with check_startmsgs
3. In savecore add a trailing '.' to the end of the message to make it
more consistent with other scripts.
4. In newsyslog remove a : before the terminal '.' since we do not
expect there to be anything printed out in between to make it more
consistent.
5. In the following scripts change "quotes" to 'quotes' where no
variables exist in the message: savecore pf newsyslog
6. [Does not apply in RELENG_8]
7. In the following scripts separate the "Starting foo:" from the
terminal '.' to make them more consistent: moused hostname pf
8. In nfsclient move the message to its own line to avoid a style bug
9. In pf rc_quiet does not apply to the _stop method, so remove the
test there.
10. In motd add 'quotes' around the terminal '.' for consistency
rmacklem [Thu, 15 Oct 2009 19:50:00 +0000 (19:50 +0000)]
MFC r197298:
Change the default transport protocol for use by the Mount protocol
and the NFS Null RPC done by mount_nfs from UDP to TCP, so that it is
consistent with the kernel, which already uses NFS over TCP by
default. Without this change, doing an NFS mount
against a server that only supports UDP results in an unusable
mount point if a transport protocol option wasn't specified for the
mount.
kib [Wed, 14 Oct 2009 14:26:19 +0000 (14:26 +0000)]
MFC r197958:
In nanosleep(2), note that the calling thread is put to sleep, not the
whole process. Also explicitely name the parameter that specifies
sleep interval.
attilio [Tue, 13 Oct 2009 13:03:31 +0000 (13:03 +0000)]
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.
kib [Tue, 13 Oct 2009 09:24:51 +0000 (09:24 +0000)]
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.