brooks [Thu, 6 Dec 2007 16:22:18 +0000 (16:22 +0000)]
MFC:
To reduce the impact of possible removal of the syscalls required by
libkse in FreeBSD 8.0, do not build or install static versions of libkse
(i.e. libkse*.a) in the default case. Static versions will be built and
installed if libthr is not built or if libkse is the default threading
library.
Discussed on: freebsd-arch
Approved by: re (kensmith)
kib [Thu, 6 Dec 2007 14:19:43 +0000 (14:19 +0000)]
MFC
rev 1.182 of src/sys/kern/imgact_elf.c
rev 1.288 of src/sys/kern/init_main.c
rev 1.312 of src/sys/kern/kern_exec.c
rev 1.85 of src/sys/kern/kern_mib.c
rev 1.496 of src/sys/sys/proc.h
rev 1.262 of src/sys/sys/systm.h
Implement fetching of the __FreeBSD_version from the ELF ABI-tag note.
The value is read into the p_osrel member of the struct proc. p_osrel
is set to 0 for the binaries without the note.
kib [Thu, 6 Dec 2007 13:47:46 +0000 (13:47 +0000)]
MFC rev. 1.181:
Check for the program headers alignment of the ELF images before
dereferencing. Unaligned access could cause panic on strict alignment
architectures.
rwatson [Thu, 6 Dec 2007 10:15:29 +0000 (10:15 +0000)]
Disable support for /dev/ptmx in FreeBSD 7.0. While it's a good idea in
principle, the current devfs-based cloning facilit makes the current
user<->kernel protocol for allocating new pts nodes difficult or
impossible to do without leading to resource leaks or race conditions.
We tentatively plan to reintroduce ptmx/pts support in FreeBSD 7.1 once
a fixed version has settled out in HEAD. People who really want to run
with the current code can re-enable it but it will require tweaking
conf files and unifdef'ing it. By removing it now before the release,
we avoid having to support the current allocation protocol in future
releases in order to provide backwards compatibility with older libc's.
Discussed with: cognet, erwin
Approved by: re (kensmith)
yongari [Thu, 6 Dec 2007 06:00:58 +0000 (06:00 +0000)]
MFC if_re.c, rev 1.98 to RELENG_7
Always honor promiscuous flag prior to programming Rx multicast
filter. This fixes a regression introduced in rev 1.89.
yongari [Thu, 6 Dec 2007 04:05:56 +0000 (04:05 +0000)]
MFC if_nfe.c, rev 1.22 to RELENG_7
Apparently some NVIDIA NICs store ethernet address in reverse order
while other variants have inorder ethernet address for the same
chipset. Override ethernet address ordering if we already know how
it was stored. This fixes the use of inversed ethernet address on
MCP67.
Make TSO work with IPSEC compiled into the kernel.
The lookup hurts a bit for connections but had been there anyway
if IPSEC was compiled in. So moving the lookup up a bit gives us
TSO support at not extra cost.
cperciva [Tue, 4 Dec 2007 22:49:18 +0000 (22:49 +0000)]
MFC revision 1.3: Add /root/, /.cshrc, and /.profile to the default
UpdateIfUnmodified directive in order to avoid overwriting these when
users upgrade to future versions of FreeBSD.
- Add the PCI side of the HOST-PCI bridge itself to the bus. This
is required by the X.Org PCI domains code and additionally needs
a workaround for Hummingbird and Sabre bridges as these don't
allow their config headers to be read at any width, which is an
unusual behavior.
- In psycho(4) take advantage of DEFINE_CLASS_0 and use more
appropriate types for some softc members.
jkoshy [Mon, 3 Dec 2007 10:50:58 +0000 (10:50 +0000)]
MFC r1.6:
"Revert revision 1.4.
Intel CPUs with family 0x6, model 0xE and later (i.e., Intel Core(TM))
have a PMC architecture that differs somewhat from previous CPUs in
family 0x6. Even though the basic programming model is similar, the
documented set of legal values that may be loaded into their PMC MSRs
differs from that of the previous PMCs in family 0x6 and reusing bit
values legal for the older PMCs could result in undefined behaviour in
the general case."
cognet [Sun, 2 Dec 2007 14:21:27 +0000 (14:21 +0000)]
MFC:
arm/at91/kb920x_machdep.c rev 1.24, 1.25 and 1.26
arm/at91/std.at91 rev 1.4
arm/at91/std.kb920x rev 1.5
arm/at91/at91rm92reg.h rev 1.6
conf/options.arm 1.18
Small tweaks to be able to load the kernel at a different address than
0x20000000 + add an option to override the default value of the master clock
frequency.
arm/at91/if_ate.c rev 1.21:
In ate_get_mac(), try to get the mac address in the right order, at least
in the same order as it's set in ate_set_mac.
MFC: rev. 1.144 sys/netinet/tcp_output.c
Let opt be an array. Though &opt[0] == opt == &opt, &opt is highly
confusing and hard to understand so change it to just opt and
remove the extra cast no longer/not needed.
attilio [Sat, 1 Dec 2007 11:28:37 +0000 (11:28 +0000)]
MFC kern_mutex.c rev. 1.201 and kern_rwlock.c rev. 1.32:
Simplify adaptive spinning algorithm which should make things faster
when sleeping / waking up waiters.
Also fix a bug with rw_try_upgrade() when adaptive spinning is enabled
as turnstile_lookup() will recurse on ts_lock that will never be
released [1].
[1] Reported by: jeff with Nokia help
Tested by: pho, kris (earlier, bugged version of rwlock part)
Discussed with: jhb, jeff
Approved by: re
darrenr [Sat, 1 Dec 2007 00:53:41 +0000 (00:53 +0000)]
MFC:
Fix 3 issues relating to the use of "auth" rules in IPFilter, from sourceforge: 1837014 Kernel panics after authentication of an outgoing packet 1836992 Potential bugs in packet auth code (w/patches) 1836967 Kernel panic when using auth rule with keep state
and another reported only to FreeBSD by Andiry (see PR)
ariff [Fri, 30 Nov 2007 15:39:22 +0000 (15:39 +0000)]
MFC:
- Remove magic number and fit max rx buffer size accurately.
- Patch registers CR47 and CR157 on devices that require it.
- Fix power calibration setting on ZD1211B.
Obtained from: OpenBSD
- Fix multicast transfer by properly reprogram multicast global
hash table, which in turns fix promiscuous mode and IPv6
autoconfiguration / local networking.
ariff [Fri, 30 Nov 2007 15:12:06 +0000 (15:12 +0000)]
MFC: (revision 1.47, 1.48)
- Add missing MCP65 id which was accidentally removed in previous commit.
- Add Analog Devices AD1984 codec id.
- Enable pcbeep control for Acer + ALC268 (nid 29). Give enough (fake)
hints so the parser will grab it and allocate "speaker" control.
- Fix regression while preparing DAC and ADC for multichannel
format. Since playback policy is to output to every possible path,
ensure that each DAC is started.
Reported / Tested by: Guy Brand
Approved by: re (kensmith)
rwatson [Thu, 29 Nov 2007 20:16:42 +0000 (20:16 +0000)]
Restore RFC 1724 hack for interface selection to RELENG_7, as routed and
other routing daemons still rely on this interface and otherwise do not
function on 7.0. It has not been restored to 8-CURRENT, so this is not
an MFC.
Reviewed by: bms
Submitted by: Marko Zec <zec icir org>
Tested by: kensmith
Approved by: re (kensmith)
cperciva [Wed, 28 Nov 2007 23:24:07 +0000 (23:24 +0000)]
Back out previous commit; i.e., turn hyperthreading back on by default.
Newer Intel processors have better hyperthreading implementations than
the original ones, and FreeBSD's SMP and scheduler code has greatly
improved between 6.x and 7.x; so hyperthreading now provides a
non-trivial performance win.
Note that security issues involving shared caches and other
microarchitectural features (e.g., dynamic branch prediction tables)
still exist; consequently, it is recommended that hyperthreading be
turned off on systems with untrusted local users. This can be
performed by setting machdep.hyperthreading_allowed=0 in
/boot/loader.conf.
Hyperthreading will continue to be disabled by default on FreeBSD 6.x.
Requested by: core
Approved by: re (kensmith)
Security: See FreeBSD-SA-05:09.htt for background information.
alc [Wed, 28 Nov 2007 22:23:35 +0000 (22:23 +0000)]
MFC revision 1.360
When reactivating a cached page, reset the page's pool to the default
pool. (Not doing this before was a performance pessimization but not
a cause for panic.)
ariff [Tue, 27 Nov 2007 23:37:48 +0000 (23:37 +0000)]
* Fix support for followings:
o Acer Aspire 4520 laptop
- jack sensing / automute
o Toshiba Satellite A135-S4527 laptop
- jack sensing / automute
Tested by: lioux
o Apple Macbook 3 (is it?)
- require gpio0 (for speakers) and ovref50 (for headphone)
to make it works
- jack sensing / automute
Tested by: Ed Schouten
* Add Nvidia MCP67 controller ids.
* Be sensible about simmilar controller with multiple pci ids.
* Connect unused DAC/ADC to stream#0 rather than forcing each of them
managing their own stream.
rwatson [Tue, 27 Nov 2007 12:22:17 +0000 (12:22 +0000)]
Merge tcp_subr.c:1.302 from HEAD to RELENG_7:
More carefully handle various cases in sysctl_drop(), such as unlocking
the inpcb when there's an inpcb without associated timewait state, and
not unlocking when the inpcb has been freed. This avoids a kernel panic
when tcpdrop(8) is run on a socket in the TIMEWAIT state.
rwatson [Tue, 27 Nov 2007 12:20:58 +0000 (12:20 +0000)]
Merge nfs_vnops.c:1.277 from HEAD to RELENG_7:
Remove hacks from the NFSv2/3 client intended to handle a lack of a
server-side RPC retranmission cache for non-idempotent operations: these
hacks substituted 0 (success) for the expected EEXIST in the event that
a target name already existed for LINK, SYMLINK, and MKDIR operations,
under the assumption that EEXIST represented a second application of the
original RPC rather than a true failure.
Background: certain NFS operations (in this case, LINK, SYMLINK, and
MKDIR) are not idempotent, as they leave behind persisting state on the
server that prevents them from being replayed without an error;if an UDP
RPC reply is lost leading to a retransmission by theclient, the second
reply will return EEXIST rather than success, asthe new object has
already been created. The NFS client previouslysilently mapped the
EEXIST return into success to paper over thisproblem.
However, in all modern NFS server implementations, a reply cache is kept
in order to retransmit the original reply to a retransmitted request,
rather than performing the operation a second time, allowing this hack
to be avoided. This allows link()-based filelocking over NFS to operate
correctly, as an application requestingthe creation of a new link for a
file to tell if it succeededatomically or not.
Other NFS clients, including Solaris and Linux, generally follow this
behavior for the same reasons. Most clients also now default to TCP,
which also helps avoid the issue of retransmitted but non-idempotent
requests in most cases.
Reported by: Adam McDougall <mcdouga9 at egr dot msu dot edu>,
Timo Sirainen <tss at iki dot fi>
Reviewed by: mohans
Let sunkbd(4) emulate an AT keyboard by default.
This has the following benefits:
- allows to use the AT keyboard maps in share/syscons/keymaps with
sunkbd(4),
- allows to use kbdmux(4) with sunkbd(4),
- allows Sun RS232 keyboards to be configured and used the same
way as Sun USB keyboards driven by ukbd(4) (which also does AT
keyboard emulation) with X.Org, putting an end to the problem
of native support for the former in X.Org being broken over and
over again.
jkim [Mon, 26 Nov 2007 17:37:24 +0000 (17:37 +0000)]
MFC: 1.356
Make VPD register access more robust:
- Implement timing out of VPD register access.
- Fix an off-by-one error of freeing malloc'd space when checksum is invalid.
- Fix style(9) bugs, i.e., sizeof cannot be followed by space.
- Retire now obsolete 'hw.pci.enable_vpd' tunable.
jkim [Mon, 26 Nov 2007 17:33:28 +0000 (17:33 +0000)]
MFC: 1.199
Do not report MAC, TX, and RX stats via sysctl(8) with BCM5705+.
The register layout is little different from memory-mapped stats
in the previous generation chips. In fact, it is bad because
registers in this range are cleared after reading them.
delphij [Mon, 26 Nov 2007 06:46:44 +0000 (06:46 +0000)]
MFC MFp4: Several fixes to tmpfs which makes it to survive from pho@'s
strees2 suite, to quote his letter, this change:
1. It removes the tn_lookup_dirent stuff. I think this cannot be fixed,
because nothing protects vnode/tmpfs node between lookup is done, and
actual operation is performed, in the case the vnode lock is dropped.
At least, this is the case with the from vnode for rename.
For now, we do the linear lookup in the parent node. This has its own
drawbacks. Not mentioning speed (that could be fixed by using hash), the
real problem is the situation where several hardlinks exist in the dvp.
But, I think this is fixable.
2. The patch restores the VV_ROOT flag on the root vnode after it became
reclaimed and allocated again. This fixes MPASS assertion at the start
of the tmpfs_lookup() reported by many.
mlaier [Sun, 25 Nov 2007 19:26:46 +0000 (19:26 +0000)]
MFC pf.c 1.51, pf_ioctl.c 1.30 and pf_if.c 1.13-1.14:
Reloop OpenBSD rev. 1.563:
In pf_test_fragment(), ignore protocol-specific criteria for packets of
different protocols.
Cleanup pf interface mangement - esp. remove EVENTHANDLER before
unloading the coresponding code. This was lost during 4.1 import.
Bring back pf_if.c revs 1.8 and 1.6 also lost during last import:
- Use correct time for tzero when compiled in
- Don't use bogus interface addresses on ptp-interfaces with :0
rwatson [Sun, 25 Nov 2007 19:15:53 +0000 (19:15 +0000)]
Merge nfs.h:1.83, nfs_srvsubs.c:1.150 from HEAD to RELENG_7:
Garbage collect now-unused nfsrv_setcred() -- it's not only unused, but
also a purveyor of unfortunate (and now unsupported) direct frobbing of
struct ucred.