Robert Watson [Sun, 11 Feb 2007 20:13:52 +0000 (20:13 +0000)]
Add uma_set_align() interface, which will be called at most once during
boot by MD code to indicated detected alignment preference. Rather than
cache alignment being encoded in UMA consumers by defining a global
alignment value of (16 - 1) in UMA_ALIGN_CACHE, UMA_ALIGN_CACHE is now
a special value (-1) that causes UMA to look at registered alignment. If
no preferred alignment has been selected by MD code, a default alignment
of (16 - 1) will be used.
Currently, no hardware platforms specify alignment; architecture
maintainers will need to modify MD startup code to specify an alignment
if desired. This must occur before initialization of UMA so that all UMA
zones pick up the requested alignment.
Craig Rodrigues [Sun, 11 Feb 2007 14:01:32 +0000 (14:01 +0000)]
Makefile changes to reflect moving sys/isofs/cd9660 to sys/fs/cd9660.
Continue to install userland include files in /usr/include/isofs/cd9660
so as not to break userland applications such as libstand.
Marcel Moolenaar [Sun, 11 Feb 2007 07:15:06 +0000 (07:15 +0000)]
Fix PowerPC-targeted cross-builds performed on 64-bit platforms.
Only PowerPC supports both 32-bit and 64-bit targets and the
BFD_DEFAULT_TARGET_SIZE is used by the binutils code to reflect
the preferred ABI. We define BFD_DEFAULT_TARGET_SIZE for all
platforms, but based on the build machine. As such 64-bit build
machines defined BFD_DEFAULT_TARGET_SIZE incorrectly for 32-bit
targets, but since this only affects PowerPC it went unnoticed
for a long time.
The fix is to define BFD_DEFAULT_TARGET_SIZE based on the target
architecture.
Marcel Moolenaar [Sun, 11 Feb 2007 02:52:54 +0000 (02:52 +0000)]
Now that the free page queue mutex is a sleep mutex, we cannot call
vm_page_alloc() from within a critical section in pmap_growkernel().
Since the need for a critical section may never have existed in the
first place, simply get rid of it.
Bruce M Simpson [Sat, 10 Feb 2007 14:48:42 +0000 (14:48 +0000)]
If the rendezvous point for a group is not specified, do not send
IGMPMSG_WHOLEPKT notifications to the userland PIM routing daemon,
as an optimization to mitigate the effects of high multicast
forwarding load.
This is an experimental change, therefore it must be explicitly enabled by
setting the sysctl/tunable net.inet.pim.squelch_wholepkt to a non-zero value.
The tunable may be set from the loader or from within the kernel environment
when loading ip_mroute.ko as a module.
Submitted by: edrt <edrt at citiz.net>
See also: http://mailman.icsi.berkeley.edu/pipermail/xorp-users/2005-June/000639.html
Bruce M Simpson [Sat, 10 Feb 2007 13:59:13 +0000 (13:59 +0000)]
Build PIM by default as part of the IPv4 multicast forwarding path.
Make PIM dynamically loadable by using encap_attach_func().
PIM may now be loaded into a GENERIC kernel.
Robert Watson [Sat, 10 Feb 2007 08:59:39 +0000 (08:59 +0000)]
In mac_biba_check_system_swapoff(), don't extract the object label since
it isn't used in the access control decision. This became visible to
Coverity with the change to a function call retrieving label values.
Luigi Rizzo [Fri, 9 Feb 2007 19:08:07 +0000 (19:08 +0000)]
Document a little more the firmware subsystem.
Apart from minor cleanup of the text, it should document
in reasonable detail what the status of the code is.
RELENG_6 has some minor differences there in the way automatic
loading/unloading is handled, but hopefully this should be
fixed by MFC time.
Ed Maste [Fri, 9 Feb 2007 17:50:26 +0000 (17:50 +0000)]
Implement RFC3442, the Classless Static Route option.
The original DHCP specification includes a route option but it supports
only class-based routes. RFC3442 adds support for specifying the netmask
width for each static route. A variable length encoding is used to minimize
the size of this option.
Yaroslav Tykhiy [Fri, 9 Feb 2007 17:18:39 +0000 (17:18 +0000)]
Let automatic TCP send buffer sizing do its job for ftpd(8): stop
setting the SO_SNDBUF socket option. Using a hard-coded value for
it was a poor idea anyway in the face of diverse network conditions.
Bruce M Simpson [Fri, 9 Feb 2007 12:35:29 +0000 (12:35 +0000)]
In the output path, mask off M_BCAST|M_MCAST so as to prevent incorrect
addressing if a packet is later re-encapsulated and sent to a
non-broadcast, non-multicast destination after being received on the
ng_ksocket input hook.
PR: 106999
Submitted by: Kevin Lahey
MFC after: 4 weeks
Tai-hwa Liang [Fri, 9 Feb 2007 02:54:13 +0000 (02:54 +0000)]
It turns out that devfs_close() does a dev_refthread() before invoking
device specific d_close(), which makes subsequent destroy_dev() being
blocked in the "devdrn" loop.
This bandaid should fix the smbfs hang/crashing observed on -CURRENT since
the introduction of sys/kern/kern_conf.c:1.199:
# mount_smbfs -I server //server/share /mnt
Password:
[hang]
Reviewed by: bp
See also: http://lists.freebsd.org/pipermail/cvs-src/2006-November/071379.html
Bruce M Simpson [Thu, 8 Feb 2007 23:05:08 +0000 (23:05 +0000)]
Store the cached route in vifp in the normal send_packet() case.
The VIFF_TUNNEL case no longer exists, therefore this field is free to
use, and its use eliminates a static data member.
Warner Losh [Thu, 8 Feb 2007 21:42:10 +0000 (21:42 +0000)]
Add sanity check to make sure that the MAC address isn't all 0's. Bad
boot loaders can do this, and this leads to all kinds of ill effects
downstream. Also, minor formatting nits.
Warner Losh [Thu, 8 Feb 2007 19:16:15 +0000 (19:16 +0000)]
Fix problem with RTL8201L PHY. From submitter:
Bugfix for the Realtek PHY driver... an RTL8201L standalone PHY
needs different handling than the integrated ones in terms of
speed detection. There was a bogus test based on the parent
device driver name string controlling which speed register to
query. That test began failing when the rl driver was split into
separate rl and re drivers some time ago. Apparently nobody ever
noticed because the buggy code only executes if NWAY negotiation
failed. Since we happen to be testing with an ancient dumb hub
rather than a modern switch, we found it.
To fix it all, have the attach() routine notice whether we're
dealing with an integrated PHY or an RTL8201L and store that info
in a struct accessible to the status() routine that needs to know
which register to query.
I touched up the fixes because they were relative to RELENG_6 and to
bring a few nits into line with style(9).
Robert Watson [Thu, 8 Feb 2007 14:33:07 +0000 (14:33 +0000)]
As VPD support still causes hard hangs on boot with some hardware, add a
tunable allowing automatic parsing of VPD data to be disabled. The
default is left as-is; if you are having problems with hard hangs at boot
due to VPD, try setting hw.pci.enable_vpd=0. A proper architectural
solution has been under discussion for some time, but this allows me to
boot my test machines in the mean time.
Tim Kientzle [Thu, 8 Feb 2007 07:25:53 +0000 (07:25 +0000)]
Update -r handling:
* Create file if it doesn't exist.
* If archive is "empty", then append to it with pax restricted
* If user specified a format, use that if it's compatible with
the existing format.
Jeff Roberson [Thu, 8 Feb 2007 01:52:25 +0000 (01:52 +0000)]
- Change types for necent runq additions to u_char rather than int.
- Fix these types in ULE as well. This fixes bugs in priority index
calculations in certain edge cases. (int)-1 % 64 != (uint)-1 % 64.
Evolve the ctlreq interface added to geom_gpt into a generic
partitioning class that supports multiple schemes. Current
schemes supported are APM (Apple Partition Map) and GPT.
Change all GEOM_APPLE anf GEOM_GPT options into GEOM_PART_APM
and GEOM_PART_GPT (resp).
The ctlreq interface supports verbs to create and destroy
partitioning schemes on a disk; to add, delete and modify
partitions; and to commit or undo changes made.
John Baldwin [Wed, 7 Feb 2007 17:43:11 +0000 (17:43 +0000)]
- Move 'struct swdevt' back into swap_pager.h and expose it to userland.
- Restore support for fetching swap information from crash dumps via
kvm_get_swapinfo(3) to fix pstat -T/-s on crash dumps.
Bruce M Simpson [Wed, 7 Feb 2007 16:04:13 +0000 (16:04 +0000)]
Remove support for IPIP tunnels in IPv4 multicast forwarding. XORP has
never used them; with mrouted, their functionality may be replaced by
explicitly configuring gif(4) instances and specifying them with the
'phyint' keyword.
Bump __FreeBSD_version to 700030, and update UPDATING.
A doc update is forthcoming.
Discussed on: net
Reviewed by: fenner
MFC after: 3 months
Fix the race of dereferencing /proc/<pid>/file with execve(2) by caching
the value of p_textvp. This way, we always unlock the locked vnode.
While there, vhold() the vnode around the vn_lock().
Reported and tested by: Guy Helmer (ghelmer palisadesys com)
Approved by: des (procfs maintainer)
MFC after: 1 week
John Baldwin [Tue, 6 Feb 2007 20:29:40 +0000 (20:29 +0000)]
Make iostat(8) fully work on crash dumps again (broken since 5.0):
- Pass the address of the variable we are reading to kvm_read() rather
than the index into the nlist array.
- Properly report errors from kvm_read() which returns -1 on error, not
0.
Bruce Evans [Tue, 6 Feb 2007 18:04:02 +0000 (18:04 +0000)]
Fixed some style bugs. Routine except:
- don't use __GNUCLIKE___OFFSETOF, since __offsetof() is a standard
FreeBSD implementaion detail which has nothing to do with GNUC.
Bruce Evans [Tue, 6 Feb 2007 16:21:09 +0000 (16:21 +0000)]
Simplified PCPU_GET() and PCPU_SET(). We must copy through a temporary
variable to avoid invalid constraints in dead code. Use an array of
u_char's (inside a struct) instead of a char/short/int/long variable so
that the variable and its accesses can be spelled in the same way in all
cases and code doesn't need to be cloned just to hold the spelling
differences.
Fixed strict-aliasing errors in PCPU_SET() and in the amd64 PCPU_GET().
Cast to (void *) as in rev.1.37 of the i386 version where the errors
were fixed for the i386 PCPU_GET() only. It would be more correct to
copy to and from the temp. variable using memcpy(), but then an
ifdef tangle would be required to ensure using the builtin memcpy().
We depend on fairly aggressive optimization to put the temp. variable
only in a register despite it being copied using
*(type *)(void *)&anothertype and could depend on this when using
memcpy() too. This seems to work right even for -O0, but the -O0 case
has not been completely tested.
This change gives identical object code for all object files in LINT
on amd64 (except for one file with a __TIME__ stamp). For LINT on
i386 it gives unimportant differences in instruction order and padding
in a few object files. This was only tested for -O.
This change (actually a previous version of it) gives the following
reductions in the number of object files in LINT that fail to compile
with -O2 but without the -fno-strict-aliasing kludge:
- amd64: 29 (down from 211)
- i386: 36 (down from 47)
gcc-3.4.6 actually allows the invalid constraints that result from not
using the temp. variable, at least with -O[1-2], but gcc-3.3.3 crashes
on them and I don't want to depend on compiler bugs.
Robert Watson [Tue, 6 Feb 2007 14:31:37 +0000 (14:31 +0000)]
Push UNIX domain socket locking further into uipc_ctloutput() in order to
avoid holding the UNIX domain socket subsystem lock over soooptcopyin()
and sooptcopyout(). This problem was introduced when LOCAL_CREDS, and
LOCAL_CONNWAIT support were added.
Robert Watson [Tue, 6 Feb 2007 14:19:25 +0000 (14:19 +0000)]
Introduce accessor functions mac_label_get() and mac_label_set() to replace
LABEL_TO_SLOT() macro used by policy modules to query and set label data
in struct label. Instead of using a union, store an intptr_t, simplifying
the API.
Update policies: in most cases this required only small tweaks to current
wrapper macros. In two cases, a single wrapper macros had to be split into
separate get and set macros.
Move struct label definition from _label.h to mac_internal.h and remove
_label.h. With this change, policies may now treat struct label * as
opaque, allowing us to change the layout of struct label without breaking
the policy module ABI. For example, we could make the maximum number of
policies with labels modifiable at boot-time rather than just at
compile-time.
Warner Losh [Tue, 6 Feb 2007 12:07:14 +0000 (12:07 +0000)]
at91_twi depends on the iicbus module to satisfy its symbols when
loaded, so make that explicit. Works for the monolithic kernel case,
won't work for the kldload case.
Robert Watson [Tue, 6 Feb 2007 10:59:23 +0000 (10:59 +0000)]
Continue 7-CURRENT MAC Framework rearrangement and cleanup:
Don't perform a nested include of _label.h in mac.h, as mac.h now
describes only the user API to MAC, and _label.h defines the in-kernel
representation of MAC labels.
Remove mac.h includes from policies and MAC framework components that do
not use userspace MAC API definitions.
Add _KERNEL inclusion checks to mac_internal.h and mac_policy.h, as these
are kernel-only include files
Craig Rodrigues [Tue, 6 Feb 2007 05:57:40 +0000 (05:57 +0000)]
Print warning that "-t msdos" is deprecated and being converted to
"-t msdosfs". The conversion has been happening since 1.43, but
no equivalent conversion happens in "umount -t", which led to some
confusion with some users.
Mike Pritchard [Tue, 6 Feb 2007 05:51:55 +0000 (05:51 +0000)]
The change to the vm_page_queue_freelist lock from a spin lock to a
sleep lock missed the witness code, and the system will panic
immediately on boot if WITNESS is enabled.
John Baldwin [Mon, 5 Feb 2007 21:48:32 +0000 (21:48 +0000)]
Change GDB_BUFSZ to be large enough to hold a register dump where each
register takes 16 characters (64-bit register in hex). In practice this
is a slight bit of overkill as 7 of the 56 registers are only 32-bit, but
having the buffer too small results in remote kgdb trashing kernel memory
when it connects.
PR: amd64/108673
Submitted by: Ravi Murty, Nikhil Rao @ Intel
MFC after: 3 days
John Polstra [Mon, 5 Feb 2007 16:36:25 +0000 (16:36 +0000)]
Use egrep instead of grep so that reporting of login failures (broken
by revision 1.6) works again. This fix is already in RELENG_6, but was
never committed to HEAD.
Colin Percival [Mon, 5 Feb 2007 16:30:40 +0000 (16:30 +0000)]
If (a == NULL), don't dereference (a) to record an error message. [1]
Fallout from changing the skip API to use off_t instead of size_t: Print
the skip length using %jd and cast to (intmax_t) instead of %d / (int),
and if ARCHIVE_API_VERSION >= 2, allow the client skipper to be called
for requests longer than SSIZE_MAX. [2]
Approved by: kientzle
Pointy hats to: kientzle [1], cperciva [2]
MFC after: 3 days
Bruce M Simpson [Mon, 5 Feb 2007 11:15:52 +0000 (11:15 +0000)]
Clean up after tun(4) properly; remove routes whose ifp is set to
that of the tun instance even for the !AF_INET case, and properly
remove configured addresses by calling if_purgeaddrs().
Maintain the TUN_DSTADDR behaviour for compatibility with the OS/390
emulator.
Alan Cox [Mon, 5 Feb 2007 06:02:55 +0000 (06:02 +0000)]
Change the free page queue lock from a spin mutex to a default (blocking)
mutex. With the demise of Alpha support, there is no longer a reason for
it to be a spin mutex.