]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoXScale core 3 definitions.
cognet [Fri, 27 Jul 2007 14:54:27 +0000 (14:54 +0000)]
XScale core 3 definitions.

Approved by: re (blanket)

16 years agoCleanup
cognet [Fri, 27 Jul 2007 14:53:42 +0000 (14:53 +0000)]
Cleanup

Approved by: re (blanket)

16 years agoDo not define NIRQ, it is already defined in include/intr.h
cognet [Fri, 27 Jul 2007 14:53:06 +0000 (14:53 +0000)]
Do not define NIRQ, it is already defined in include/intr.h

Approved by: re (blanket)

16 years agoShare the timer and watchdog drivers with the i81342. It's the same,
cognet [Fri, 27 Jul 2007 14:52:04 +0000 (14:52 +0000)]
Share the timer and watchdog drivers with the i81342. It's the same,
except it uses different registers.

Approved by: re (blanket)

16 years agoAdd initial IOP342 support.
cognet [Fri, 27 Jul 2007 14:50:57 +0000 (14:50 +0000)]
Add initial IOP342 support.
Thanks to Intel for providing sample hardware.

Approved by: re (blanket)

16 years agoSay if the L2 cache is enabled or disabled as well.
cognet [Fri, 27 Jul 2007 14:49:11 +0000 (14:49 +0000)]
Say if the L2 cache is enabled or disabled as well.

Approved by: re (blanket)

16 years agoUse coherent mapping for DMA on arm. This is propably suitable for the
cognet [Fri, 27 Jul 2007 14:48:05 +0000 (14:48 +0000)]
Use coherent mapping for DMA on arm. This is propably suitable for the
other archs, but I can't test it so I made it conditionnal on __arm__
for now.

Approved by: re (blanket)

16 years agoHandle supersections and L2 cache.
cognet [Fri, 27 Jul 2007 14:46:43 +0000 (14:46 +0000)]
Handle supersections and L2 cache.

Approved by: re (blanket)

16 years agoUse supersection instead of standard sections to map the whole memory
cognet [Fri, 27 Jul 2007 14:46:15 +0000 (14:46 +0000)]
Use supersection instead of standard sections to map the whole memory
when available.

Approved by: re (blanket)

16 years agoFix the cache mode description.
cognet [Fri, 27 Jul 2007 14:45:33 +0000 (14:45 +0000)]
Fix the cache mode description.

Approved by: re (blanket)

16 years agoProperly handle supersections.
cognet [Fri, 27 Jul 2007 14:45:04 +0000 (14:45 +0000)]
Properly handle supersections.
Make sure we cache entries in the L2 cache.

Approved by: re (blanket)

16 years agoBring in two bandaids to get the elf trampoline to work again, until I find
cognet [Fri, 27 Jul 2007 14:42:25 +0000 (14:42 +0000)]
Bring in two bandaids to get the elf trampoline to work again, until I find
a proper solution.
- Add a dummy entry point which just calls the C entry points, and try to make
sure it's the first code in the binary.
- Copy a bit more than func_end to try to copy the whole load_kernel()
function. gcc4 puts code behind the func_end symbol.

Approved by: re (blanket)

16 years agoAdd a new set of functions to handle L2 cache. Make them no-op for every
cognet [Fri, 27 Jul 2007 14:39:41 +0000 (14:39 +0000)]
Add a new set of functions to handle L2 cache. Make them no-op for every
CPU except Xscale core 3.

Approved by: re (blanket)

16 years agoImport xscale core 3 cache management functions.
cognet [Fri, 27 Jul 2007 14:28:15 +0000 (14:28 +0000)]
Import xscale core 3 cache management functions.

Approved by: re (blanket)

16 years agoINTR_FILTER bits for arm
cognet [Fri, 27 Jul 2007 14:26:42 +0000 (14:26 +0000)]
INTR_FILTER bits for arm

Approved by: re (blanket)

16 years agoUpdate for japanese holidays.
bland [Fri, 27 Jul 2007 12:09:55 +0000 (12:09 +0000)]
Update for japanese holidays.

PR: 114732
Approved by: re (rwatson)

16 years agoMinor Bug fix that will cause panic with some terminal with voice path on USB.
takawata [Fri, 27 Jul 2007 12:00:29 +0000 (12:00 +0000)]
Minor Bug fix that will cause panic with some terminal with voice path on USB.

Approved by: re@ (kensmith)

16 years agoFirst in a series of changes to remove the now-unused Giant compatibility
rwatson [Fri, 27 Jul 2007 11:59:57 +0000 (11:59 +0000)]
First in a series of changes to remove the now-unused Giant compatibility
framework for non-MPSAFE network protocols:

- Remove debug_mpsafenet variable, sysctl, and tunable.
- Remove NET_NEEDS_GIANT() and associate SYSINITSs used by it to force
  debug.mpsafenet=0 if non-MPSAFE protocols are compiled into the kernel.
- Remove logic to automatically flag interrupt handlers as non-MPSAFE if
  debug.mpsafenet is set for an INTR_TYPE_NET handler.
- Remove logic to automatically flag netisr handlers as non-MPSAFE if
  debug.mpsafenet is set.
- Remove references in a few subsystems, including NFS and Cronyx drivers,
  which keyed off debug_mpsafenet to determine various aspects of their own
  locking behavior.
- Convert NET_LOCK_GIANT(), NET_UNLOCK_GIANT(), and NET_ASSERT_GIANT into
  no-op's, as their entire behavior was determined by the value in
  debug_mpsafenet.
- Alias NET_CALLOUT_MPSAFE to CALLOUT_MPSAFE.

Many remaining references to NET_.*_GIANT() and NET_CALLOUT_MPSAFE are still
present in subsystems, and will be removed in followup commits.

Reviewed by: bz, jhb
Approved by: re (kensmith)

16 years agoIt seems that some i386 mothermoards either do not implement the
dwmalone [Fri, 27 Jul 2007 09:34:42 +0000 (09:34 +0000)]
It seems that some i386 mothermoards either do not implement the
day of week field correctly, or they remember bad values that are
written into the day of week field. For this reason, ignore the day
of week field when reading the clock on i386 rather than bailing if
it is set incorrectly.

Problems were seen on a number of platforms, including VMWare, qemu,
EPIA ME6000, Epox-3PTA and ABIT-SL30T.

This is a slightly different fix to that proposed by Ted in his PR,
but the same basic idea.

PR: 111117
Submitted by: Ted Faber <faber@lunabase.org>
Approved by: re (rwatson)
MFC after: 3 weeks

16 years agoActually, upcalls cannot be freed while destroying the thread because we
attilio [Fri, 27 Jul 2007 09:21:18 +0000 (09:21 +0000)]
Actually, upcalls cannot be freed while destroying the thread because we
should call uma_zfree() with various spinlock helds.  Rearranging the
code would not help here because we cannot break atomicity respect
prcess spinlock, so the only one choice we have is to defer the operation.
In order to do this use a global queue synchronized through the kse_lock
spinlock which is freed at any thread_alloc() / thread_wait() through a
call to thread_reap().
Note that this approach is not ideal as we should want a per-process
list of zombie upcalls, but it follows initial guidelines of KSE authors.

Tested by: jkim, pav
Approved by: jeff, julian
Approved by: re

16 years agoModified release notes:
brueffer [Fri, 27 Jul 2007 08:40:05 +0000 (08:40 +0000)]
Modified release notes:
- hostapd update to 0.5.8
- wpa_supplicant update to 0.5.8
- KDE update to 3.5.7

Approved by: re (blanket)

16 years agoContinue effort to improve parity between UDPv4 and UDPv6: add a missing
rwatson [Fri, 27 Jul 2007 08:25:02 +0000 (08:25 +0000)]
Continue effort to improve parity between UDPv4 and UDPv6: add a missing
scope security check for the UDPv6 socket credential lookup service,
allowing security policies to bound access to credential information.
While not an immediate issue for Jail, which doesn't allow use of UDPv6,
this may be relevant to other security policies that may wish to control
ident lookups.

While here, eliminate a very unlikely panic case, in which a socket in
the process of being freed is inspected by the sysctl.

Approved by: re (kensmith)
Reviewed by: bz

16 years agoExport the contents of the syncache to netstat.
silby [Fri, 27 Jul 2007 00:57:06 +0000 (00:57 +0000)]
Export the contents of the syncache to netstat.

Approved by: re (kensmith)
MFC after: 2 weeks

16 years agostyle(9)
yongari [Fri, 27 Jul 2007 00:43:12 +0000 (00:43 +0000)]
style(9)

Pointed out by: cnst
Approved by: re (kensmith)

16 years agoAvoid holding the softc lock when using copyout().
thompsa [Thu, 26 Jul 2007 20:30:18 +0000 (20:30 +0000)]
Avoid holding the softc lock when using copyout().

Reported by: dfr
Approved by: re (rwatson)

16 years agoFix up ndis interaction with net80211
thompsa [Thu, 26 Jul 2007 20:11:16 +0000 (20:11 +0000)]
Fix up ndis interaction with net80211
 - make NDIS_DEBUG a sysctl
 - default to IEEE80211_MODE_11B if the card doesnt tell us the channels
 - dont mess with ic_des_chan when we assosciate
 - Allow a directed scan by setting the ESSID before scanning (verified
   with wireshark). Hidden APs probably wouldnt have worked before.
 - Grab the channel type and use it to look up the correct curchan for
   the scan results (mistakenly used 11B before)
 - Fix memory leak in the ndis_scan_results

Tested by: matteo
Reviewed by: sam
Approved by: re (rwatson)

16 years agoReduce stack usage by 256 bytes per call. It helps to avoid kernel
mav [Thu, 26 Jul 2007 18:15:02 +0000 (18:15 +0000)]
Reduce stack usage by 256 bytes per call. It helps to avoid kernel
stack overflow in complicated traffic filtering setups.

There can be minor performance degradation for the MHLEN < len <= 256 case
due to additional buffer allocation, but it is a rare case.

Approved by: re (rwatson), glebius (mentor)
MFC after: 1 week

16 years agoWhen we do open, we should lock the vnode exclusively. This fixes few races:
pjd [Thu, 26 Jul 2007 16:58:09 +0000 (16:58 +0000)]
When we do open, we should lock the vnode exclusively. This fixes few races:
- fifo race, where two threads assign v_fifoinfo,
- v_writecount modifications,
- v_object modifications,
- and probably more...

Discussed with: kib, ups
Approved by: re (rwatson)

16 years agoThe v_mountedhere field is protected by the vnode lock, not vnode's internal
pjd [Thu, 26 Jul 2007 16:52:57 +0000 (16:52 +0000)]
The v_mountedhere field is protected by the vnode lock, not vnode's internal
lock.

Approved by: re (rwatson)

16 years agoIf the trap number stored in the trapframe is corrupted into a negative
jhb [Thu, 26 Jul 2007 15:32:55 +0000 (15:32 +0000)]
If the trap number stored in the trapframe is corrupted into a negative
value, then we would use a negative index into the trap_msg[] array
resulting in a nested page fault.  Make the 'type' variable holding the
trap number unsigned to avoid this.

MFC after: 2 weeks
Approved by: re (rwatson)

16 years agoHonor the IFF_MONITOR flag.
glebius [Thu, 26 Jul 2007 10:54:33 +0000 (10:54 +0000)]
Honor the IFF_MONITOR flag.

PR: kern/99500
Submitted by: Craig Leres <leres ee.lbl.gov>
Approved by: re (kensmith)

16 years agoFix comments in tcp_do_segment().
andre [Wed, 25 Jul 2007 18:48:24 +0000 (18:48 +0000)]
Fix comments in tcp_do_segment().

Approved by: re (kensmith)

16 years agoRequire 'cleanvar' so that files and sockets created in /var/run by
jhb [Wed, 25 Jul 2007 18:08:01 +0000 (18:08 +0000)]
Require 'cleanvar' so that files and sockets created in /var/run by
wpa_supplicant and other programs started by 'netif' don't get erased
by a subsequent 'cleanvar'.

Approved by: re (bmah)
Reviewed by: dougb
MFC after: 1 week

16 years agoNew release note: iscsi_initiator(8).
bmah [Wed, 25 Jul 2007 15:19:37 +0000 (15:19 +0000)]
New release note:  iscsi_initiator(8).

Updated release notes:  BIND 9.4.1-p1, OpenBSM 1.0alpha15.

Approved by: re (implicit)

16 years agoFix a whitespace mistake from the last commit.
scottl [Wed, 25 Jul 2007 13:37:33 +0000 (13:37 +0000)]
Fix a whitespace mistake from the last commit.

Submitted by: far too many to list
Approved by: re

16 years agoThis commit was generated by cvs2svn to compensate for changes in r171577,
dougb [Wed, 25 Jul 2007 08:12:36 +0000 (08:12 +0000)]
This commit was generated by cvs2svn to compensate for changes in r171577,
which included commits to RCS files with non-trunk default branches.

16 years agoVendor import of 9.4.1-P1, which has fixes for the following:
dougb [Wed, 25 Jul 2007 08:12:36 +0000 (08:12 +0000)]
Vendor import of 9.4.1-P1, which has fixes for the following:

1. The default access control lists (acls) are not being
correctly set. If not set anyone can make recursive queries
and/or query the cache contents.

See also:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-2925

2. The DNS query id generation is vulnerable to cryptographic
analysis which provides a 1 in 8 chance of guessing the next
query id for 50% of the query ids. This can be used to perform
cache poisoning by an attacker.

This bug only affects outgoing queries, generated by BIND 9 to
answer questions as a resolver, or when it is looking up data
for internal uses, such as when sending NOTIFYs to slave name
servers.

All users are encouraged to upgrade.

See also:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-2926

Approved by: re (kensmith, implicit)

16 years agoStart to converge on standard ways of saying some things like
imp [Wed, 25 Jul 2007 07:11:08 +0000 (07:11 +0000)]
Start to converge on standard ways of saying some things like
Ethernet and Adapter.

Obtained from: NetBSD (kinda)
Approved by: re (blanket)

16 years agoFix absolutely maddening autorepeat bug that would cause the last key
imp [Wed, 25 Jul 2007 06:48:33 +0000 (06:48 +0000)]
Fix absolutely maddening autorepeat bug that would cause the last key
to repeat if you had more than two keys down at any given time (which
happened to me all the time with emacs).

This is taken from PR 110681, although what URATAN Shigenobu describes
there is different than the pathology that I have been seeing.  I'm
seeing this only in X, while he sees it on his console, yet I think
the two problems are related.  I've also reworked the patch slightly
to conform to the coding standards of adjacent code.

It is unclear to me if this merely masks the maddening bug that I have
seen, or if this is a real fix.  I typically see the problem when I'm
typing fast in emacs and using lots of motion keys (meta and control).
In either case, my workstation at work again is finally useful with
this patch.

PR: 110681
Submitted by: URATAN Shigenobu
Approved by:  re (blanket)

16 years agoums(4) does not work if the mouse defaults to boot protocol. Force
imp [Wed, 25 Jul 2007 06:43:06 +0000 (06:43 +0000)]
ums(4) does not work if the mouse defaults to boot protocol.  Force
the protocol to be report on each open, but ignore any errors as set
protocol for mice that don't implement the boot protocol can generate
an error.  Evidentally, the Gyration GyroPoint RF Technology Receiver
(Gyration Ultra Cordless) device has this problem.

Submitted by: Eugene M. Kim
PR: 106565
Approved by: re (blanket)

16 years ago - take out a needless panic under invariants for sctp_output.c
rrs [Tue, 24 Jul 2007 20:06:02 +0000 (20:06 +0000)]
 - take out a needless panic under invariants for sctp_output.c
 - Fix addrs's error checking of sctp_sendx(3) when addrcnt is less than
   SCTP_SMALL_IOVEC_SIZE
 - re-add back inpcb_bind local address check bypass capability
 - Fix it so sctp_opt_info is independant of assoc_id postion.
 - Fix cookie life set to use MSEC_TO_TICKS() macro.
 - asconf changes
   o More comment changes/clarifications related to the old local address
    "not" list which is now an explicit restricted list.

   o Rename some functions for clarity:
     - sctp_add/del_local_addr_assoc to xxx_local_addr_restricted()
     - asconf related iterator functions to sctp_asconf_iterator_xxx()

   o Fix bug when the same address is deleted and added (and removed from
     the asconf queue) where the ifa is "freed" twice refcount wise,
     possibly freeing it completely.

   o Fix bug in output where the first ASCONF would not go out after the
     last address is changed (e.g. only goes out when retransmitted).

   o Fix bug where multiple ASCONFs can be bundled in the same packet with
     the and with the same serial numbers.

   o Fix asconf stcb iterator to not send ASCONF until after all work
     queue entries have been processed.

   o Change behavior so that when the last address is deleted (auto asconf
     on a bound all endpoint) no action is taken until an address is
     added; at that time, an ASCONF add+delete is sent (if the assoc
     is still up).

   o Fix local address counting so that address scoping is taken into
     account.

   o #ifdef SCTP_TIMER_BASED_ASCONF the old timer triggered sending
     of ASCONF (after an RTO).  The default now is to send
     ASCONF immediately (except for the case of changing/deleting the
     last usable address).
Approved by: re(ken smith)@freebsd.org

16 years agoFirst round of cleanups.
brueffer [Tue, 24 Jul 2007 18:08:16 +0000 (18:08 +0000)]
First round of cleanups.

Approved by: re (blanket)

16 years agoMFp4: Force 64-bit arithmatic when caculating the maximum file size.
delphij [Tue, 24 Jul 2007 17:14:53 +0000 (17:14 +0000)]
MFp4: Force 64-bit arithmatic when caculating the maximum file size.
This fixes tmpfs caculations on 32-bit systems equipped with more than
4GB swap.

Reported by: Craig Boston <craig xfoil gank org>
PR: kern/114870
Approved by: re (tmpfs blanket)

16 years agoAttach the iscsi module build.
scottl [Tue, 24 Jul 2007 16:58:18 +0000 (16:58 +0000)]
Attach the iscsi module build.

Approved by: re

16 years agoIntroduce Danny Braniss' iSCSI initiator, version 2.0.99. Please read the
scottl [Tue, 24 Jul 2007 15:35:02 +0000 (15:35 +0000)]
Introduce Danny Braniss' iSCSI initiator, version 2.0.99.  Please read the
included man pages on how to use it.  This code is still somewhat experimental
but has been successfully tested on a number of targets.  Many thanks to
Danny for contributing this.

Approved by: re

16 years agoUpdate assertion after revision 1.23.
pjd [Tue, 24 Jul 2007 15:00:43 +0000 (15:00 +0000)]
Update assertion after revision 1.23.

Reviewed by: dfr
Approved by: re (rwatson)

16 years agoAdd some additional cross references.
imp [Tue, 24 Jul 2007 14:51:21 +0000 (14:51 +0000)]
Add some additional cross references.

Approved by: re@ (blanket)

16 years agoAdd ChanTou ST268 USB NIC
imp [Tue, 24 Jul 2007 14:49:25 +0000 (14:49 +0000)]
Add ChanTou ST268 USB NIC

PR: 114860
Approved by: re@ (blanket)

16 years agoAdd support for ShanTou ST268 usb nic. This is from a patch for NetBSD
imp [Tue, 24 Jul 2007 14:44:23 +0000 (14:44 +0000)]
Add support for ShanTou ST268 usb nic.  This is from a patch for NetBSD
the PR pointed to.  This appears to have been written by Julian Suschlik.

Submitted by: Kuan-Chung Chiu
Obtained from: http://www.nabble.com/Patch-for-udav(4)-t4070804.html
PR: 114860
Approved by: re@ (blanket)

16 years agoSet timeout for all NIS RPC requests to 1 second and not just for
simon [Tue, 24 Jul 2007 13:06:08 +0000 (13:06 +0000)]
Set timeout for all NIS RPC requests to 1 second and not just for
yp_next as revision 1.50 did.  This should fix, or at least very much
reduce the risk of, NIS timing out due to UDP packet loss for NIS
functions.

See also revision 1.50 for more details about the general problem.

Tested by: nosedive, freefall, hub, mx1, brooks
MFC after: 1 week
Approved by: re (mux)

16 years agoStop mentioning /usr/X11R6.
delphij [Tue, 24 Jul 2007 06:41:07 +0000 (06:41 +0000)]
Stop mentioning /usr/X11R6.

Approved by: re (hrs)

16 years agoAdd MSI support.
yongari [Tue, 24 Jul 2007 01:24:03 +0000 (01:24 +0000)]
Add MSI support.
Ever since switching to adaptive polling re(4) occasionally spews
watchdog timeouts on systems with MSI capability. This change is
minimal one for supporting MSI and re(4) also needs MSIX support
for RTL8111C in future. Because softc structure of re(4) is shared
with rl(4), rl(4) was touched to use the modified softc.

Reported by: cnst
Tested by: cnst
Approved by: re (kensmith)

16 years agoDon't fail on device attach if jumbo frame support was unsuccessful.
yongari [Tue, 24 Jul 2007 01:11:00 +0000 (01:11 +0000)]
Don't fail on device attach if jumbo frame support was unsuccessful.
Because nfe(4) hardware doesn't support SG on Rx path, supporting
jumbo frame requires very large contiguous kernel memory(i.e. several
mega bytes). In case of lack of contiguous kernel memory that
allocation request may always fail. However nfe(4) can operate on normal
sized MTU frames, so go ahead and just disable jumbo frame support.
While I'm here add a new tunable "hw.nfe.jumbo_disable" to disable
jumbo frame support.
In nfe_poll, make sure to invoke correct Rx handler.

Approved by: re (kensmith)

16 years agoupcall_free() was only used in kse_GC() which has been removed so it now
attilio [Mon, 23 Jul 2007 23:16:53 +0000 (23:16 +0000)]
upcall_free() was only used in kse_GC() which has been removed so it now
results unused; this, with -Werror option of gcc, rise a warning for gcc
which let the buildkernel to be busted.
Fix this removing upcall_free().

Reported by: various
Approved by: jeff
Approved by: re
Pointy hat to: attilio

16 years agoActually, KSE kernel bits locking is broken and can lead likely to
attilio [Mon, 23 Jul 2007 14:52:22 +0000 (14:52 +0000)]
Actually, KSE kernel bits locking is broken and can lead likely to
dangerous races.
Fix this problems adding correct locking for the members of 'struct
kse_upcall' and other struct proc/struct thread related members.
For the moment, just leave ku_mflag and ku_flags "lazy" locked.
While here, cleanup the code removing the function kse_GC() (unused),
and merging upcall_link(), upcall_unlink(), upcall_stash() in their
respective callers (static functions, very short and only called in one
place).

Reported by: pav
Tested by: pav (on some pointyhat cluster nodes)
Approved by: jeff
Approved by: re
Sponsorized by: NGX Italy (http://www.ngx.it)

16 years agoWhen checking labels during a vnode link operation in MLS, use the file
rwatson [Mon, 23 Jul 2007 13:28:54 +0000 (13:28 +0000)]
When checking labels during a vnode link operation in MLS, use the file
vnode label for a check rather than the directory vnode label a second
time.

MFC after: 3 days
Submitted by: Zhouyi ZHOU <zhouzhouyi at FreeBSD dot org>
Reviewed by: csjp
Sponsored by: Google Summer of Code 2007
Approved by: re (bmah)

16 years agoIf clock_ct_to_ts fails to convert time time from the real time clock,
dwmalone [Mon, 23 Jul 2007 09:42:32 +0000 (09:42 +0000)]
If clock_ct_to_ts fails to convert time time from the real time clock,
print a one line error message. Add some comments on not being able to
trust the day of week field (I'll act on these comments in a follow up
commit).

Approved by: re
MFC after: 3 weeks

16 years agoContinue effort to align UDPv4 and UDPv6 implementations by merging
rwatson [Mon, 23 Jul 2007 07:58:58 +0000 (07:58 +0000)]
Continue effort to align UDPv4 and UDPv6 implementations by merging
udp6_output() from udp6_output.c to udp6_usrreq.c, matching the UDPv4
structure, and allowing us to remove udp6_output.c.

Reviewed by: bz, gnn
Approved by: re (bmah)

16 years agoMake using msdosfs as the root file system sort of work:
bde [Mon, 23 Jul 2007 07:10:17 +0000 (07:10 +0000)]
Make using msdosfs as the root file system sort of work:

o Initialize ownerships and permissions.  They were garbage (0) for
  root mounts since vfs_mountroot_try() doesn't ask for them to be set
  and msdosfs's old incomplete code to set them was removed.  The
  garbage happened to give the correct ownerships root:wheel, but it
  gave permissions 000 so init could not be execed.  Use the macros
  for root: wheel and 0755.  (The removed code gave 0:0 and 0777.  0755
  is more normal and secure, thought wrong for /tmp.)

o Check the readonly flag for initial (non-MNT_UPDATE) mounts in the
  correct place, as in ffs.  For root mounts, it is only passed in
  mp->mnt_flags, since vfs_mountroot_try() only passes it as a flag
  and nothing translates the flag to the "ro" option string.  msdosfs
  only looked for it in the string, so it gave a rw mount for root
  mounts without even clearing the flag in mp->mnt_flags, so the final
  state was inconsistent.  Checking the flag only in mp->mnt_flags
  works for initial userland mounts too.  The MNT_UPDATE case is
  messier.

The main point that should work but doesn't is fsck of msdosfs root
while it is mounted ro.  This needs mainly MNT_RELOAD support to work.
It should be possible to run fsck -p and succeed provided the fs is
consistent, not just for msdosfs, but this fails because fsck -p always
tries to open the device rw.  The hack that allows open for writing
in ffs is not implemented in msdosfs, since without MNT_RELOAD support
writing could only be harmful.  So fsck must be turned off to use
msdosfs as root.  This is quite dangerous, since msdosfs is still missing
actually using its fs-dirty flag internally, so it is happy to mount
dirty fileystems rw.

Unrelated changes:
- Fix missing error handling for MNT_UPDATE from rw to ro.
- Catch up with renaming msdos to msdosfs in a string.

Approved by: re (kensmith)

16 years agoMFp4: When swapping is not enabled, allow creating files by taking
delphij [Mon, 23 Jul 2007 06:54:58 +0000 (06:54 +0000)]
MFp4: When swapping is not enabled, allow creating files by taking
physical memory pages into account for tm_maxfilesize.

Reported by: Dominique Goncalves <dominique.goncalves gmail.com>
Submitted by: Howard Su
Approved by: re (tmpfs blanket)

16 years agoPreprocessing stub "KSE" breaks ABI either with modules and userspace
attilio [Sun, 22 Jul 2007 21:35:44 +0000 (21:35 +0000)]
Preprocessing stub "KSE" breaks ABI either with modules and userspace
consumers.
This patch makes KSE no more an optionally stub for kernel structures
fixing the breakage.
As a tail note, this bug has broken kqemu for a long period now.

Tested by: Ulf Lilleengen <lulf@FreeBSD.org>
Discussed with: rwatson, jeff
Approved by: jeff (mentor)
Approved by: re

16 years agondis will signal the kthread to exit and then sleep on the proc pointer to
thompsa [Sun, 22 Jul 2007 20:53:28 +0000 (20:53 +0000)]
ndis will signal the kthread to exit and then sleep on the proc pointer to
be woken up by kthread_exit. This is racey and in some cases the kthread will
exit before ndis gets around to sleep so it will be stuck indefinitely. This
change reuses the kq_exit variable to indicate that the thread has gone and
will loop on tsleep with a timeout waiting for it. If the kthread has already
exited then it will not sleep at all.

Approved by: re (rwatson)

16 years agoThe HPET appears to be broken on silby's Acer Pentium M system, never
njl [Sun, 22 Jul 2007 20:45:27 +0000 (20:45 +0000)]
The HPET appears to be broken on silby's Acer Pentium M system, never
advancing.  Read from the timer before attaching to be sure it advances
in 1 us.  Since the slowest rate allowed by the spec is 10 MHz, the
timer is guaranteed to change in this interval if it is working.

Tested by: Rui Paulo
Approved by: re
MFC after: 3 days

16 years agoChange new Wi-Spy device name to Wi-Spy 2.4x.
imp [Sun, 22 Jul 2007 18:29:18 +0000 (18:29 +0000)]
Change new Wi-Spy device name to Wi-Spy 2.4x.

Submitted by: Brix Andersen
Approved by: re@ (blanket)
PR: 114807

16 years agoWISPY added an X.
imp [Sun, 22 Jul 2007 15:59:45 +0000 (15:59 +0000)]
WISPY added an X.

Approved by: re

16 years agoApply the same error checks to PAM_TTY in pam_sm_close_session() as in
des [Sun, 22 Jul 2007 15:17:29 +0000 (15:17 +0000)]
Apply the same error checks to PAM_TTY in pam_sm_close_session() as in
pam_sm_open_session(), avoiding false negatives when no tty is present.

Submitted by: Todd C. Miller <millert@courtesan.com>
Approved by: re (rwatson)
MFC after: 2 weeks

16 years agoWhitespace cleanup
des [Sun, 22 Jul 2007 15:14:40 +0000 (15:14 +0000)]
Whitespace cleanup

Approved by: re (rwatson)

16 years agoMerge OpenBSM 1.0 alpha 15 changes to src/sys/bsm:
rwatson [Sun, 22 Jul 2007 12:28:13 +0000 (12:28 +0000)]
Merge OpenBSM 1.0 alpha 15 changes to src/sys/bsm:

- Synchronized audit event list to Solaris, picking up the *at(2) system call
  definitions, now required for FreeBSD and Linux.  Added additional events
  for *at(2) system calls not present in Solaris.

Obtained from: TrustedBSD Project
Approved by: re (hrs)

16 years agoUpdate generated OpenBSM config.h for OpenBSM 1.0 alpha15 update.
rwatson [Sun, 22 Jul 2007 12:22:25 +0000 (12:22 +0000)]
Update generated OpenBSM config.h for OpenBSM 1.0 alpha15 update.

Approved by: re (hrs)

16 years agoResolve conflicts from import of OpenBSM 1.0 alpha15 ($FreeBSD$/$P4$
rwatson [Sun, 22 Jul 2007 12:20:42 +0000 (12:20 +0000)]
Resolve conflicts from import of OpenBSM 1.0 alpha15 ($FreeBSD$/$P4$
conflict).

Approved by: re (hrs)

16 years agoThis commit was generated by cvs2svn to compensate for changes in r171537,
rwatson [Sun, 22 Jul 2007 12:18:31 +0000 (12:18 +0000)]
This commit was generated by cvs2svn to compensate for changes in r171537,
which included commits to RCS files with non-trunk default branches.

16 years agoVendor import TrustedBSD OpenBSM 1.0 alpha 15, with the following change
rwatson [Sun, 22 Jul 2007 12:18:31 +0000 (12:18 +0000)]
Vendor import TrustedBSD OpenBSM 1.0 alpha 15, with the following change
history since the last import:

OpenBSM 1.0 alpha 15

- Fix bug when processing in_addr_ex tokens.
- Restore the behavior of printing the string/text specified while
  auditing arg32 tokens.
- Synchronized audit event list to Solaris, picking up the *at(2) system call
  definitions, now required for FreeBSD and Linux.  Added additional events
  for *at(2) system calls not present in Solaris.
- Bugs in auditreduce(8) fixed allowing partial date strings to be used in
  filtering events.

Approved by: re (hrs)
MFC after: 3 weeks
Obtained from: TrustedBSD Project

16 years agoInclude the <sys/sysproto.h> header which includes the prerequisite header
kevlo [Sun, 22 Jul 2007 06:48:34 +0000 (06:48 +0000)]
Include the <sys/sysproto.h> header which includes the prerequisite header
for AUE_NULL.

Approved by: re (kensmith)

16 years agoUse bus_get_dma_tag() to obtain the parent DMA tag.
kevlo [Sun, 22 Jul 2007 06:44:10 +0000 (06:44 +0000)]
Use bus_get_dma_tag() to obtain the parent DMA tag.

Reviewed by: sam, sephe, thompsa
Approved by: re (kensmith)

16 years agoAdd some additional devices.
imp [Sun, 22 Jul 2007 03:45:35 +0000 (03:45 +0000)]
Add some additional devices.

Submitted by: HPS hselasky at c2i dot net
Approved by: re (blanket)

16 years ago- remove duplicate code from sctp_asconf.c
rrs [Sat, 21 Jul 2007 21:41:32 +0000 (21:41 +0000)]
- remove duplicate code from sctp_asconf.c
- remove duplicate #include <sys/priv.h> that is not under
   #ifdef FreeBSD version to allow compile on 6.1
- static analysis changes per the cisco SA tool including:
    o some SA_IGNORE comments
    o some checks for NULL before unlock.
    o type corrections int -> size_t
- Fix it so sctp_alloc_asoc takes a thread/proc argument. Without this
   we pass a NULL in to bind on implicit assoc setup and crash  :-(
Approved by: re@freebsd.org(Ken Smith)

16 years agoPut local symbol suppression rule into most recent (e.g. last) version
kan [Sat, 21 Jul 2007 20:52:32 +0000 (20:52 +0000)]
Put local symbol suppression rule into most recent (e.g. last) version
block.

Approved by: re (kensmith)

16 years agoDo not forget to cam_periph_unhold the peripheral before exiting
kan [Sat, 21 Jul 2007 18:07:45 +0000 (18:07 +0000)]
Do not forget to cam_periph_unhold the peripheral before exiting
due to error.

PR: kern/114636
Submitted by: Tijl Coosemans
Approved by: re (hrs)

16 years ago- Correctly substitute variables like @NCURSES_MAJOR@ in manual pages
rafan [Sat, 21 Jul 2007 00:27:17 +0000 (00:27 +0000)]
- Correctly substitute variables like @NCURSES_MAJOR@ in manual pages

PR: doc/114711
Submitted by: Yuri Pankov <yuri at darklight.org.ru>
Approved by: re (bmah)
MFC after: 3 days

16 years agoAdded environ-replacement detection. For programs that "clean" (i.e., su)
scf [Fri, 20 Jul 2007 23:30:13 +0000 (23:30 +0000)]
Added environ-replacement detection.  For programs that "clean" (i.e., su)
or replace (i.e., zdump) the environment after a call to setenv(), putenv()
or unsetenv() has been made, a few changes were made.
  - getenv() will return the value from the new environ array.
  - setenv() was split into two functions:  __setenv() which is most of the
    previous setenv() without checks on the name and setenv() which
    contains the checks before calling __setenv().
  - setenv(), putenv() and unsetenv() will unset all previous values and
    call __setenv() on all entries in the new environ array which in turn
    adds them to the end of the envVars array.  Calling __setenv() instead
    of setenv() is done to avoid the temporary replacement of the '=' in a
    string with a NUL byte.  Some strings may be read-only data.

Added more regression checks for clearing the environment array.

Replaced gettimeofday() with getrusage() in timing regression check for
better accuracy.

Fixed an off-by-one bug in __remove_putenv() in the use of memmove().  This
went unnoticed due to the allocation of double the number of environ
entries when building envVars.

Fixed a few spelling mistakes in the comments.

Reviewed by: ache
Approved by: wes
Approved by: re (kensmith)

16 years agoFix Symbios driver on amd64: Since amd64 has 64 bit pointers but the same
se [Fri, 20 Jul 2007 23:02:01 +0000 (23:02 +0000)]
Fix Symbios driver on amd64: Since amd64 has 64 bit pointers but the same
4KB pages as i386, data structures that just fit in one page on i386 (and
on 64 bit architectures with 8KB pages) can be distributed over two pages
on amd64. This is a porblem in the case of the Symbios driver, since the
SCRIPTS engine in the SCSI chip operates on physical addresses and needs
physically contiguous memory. Earlier patches used contigmalloc on amd64,
but this version replaces part of a structure by a pointer to that data.
In order to not introduce an extra indirection for other architectures,
the change has been made conditional on __amd64__.

Earlier attempts to repair this problem are removed (i.e. the macros that
made amd64 use contigmalloc). The fix was submitted by Jan Mikkelsen and
modified by me to only affect amd64.

PR: 89550
Submitted by: janm at transactionware dot com (Jan Mikkelsen)
Approved by: re (Hiroki Sato)
MFC after: 2 weeks

16 years agoImplement vfs clustering for msdosfs.
bde [Fri, 20 Jul 2007 17:06:57 +0000 (17:06 +0000)]
Implement vfs clustering for msdosfs.

This gives a very large speedup for small block sizes (in my tests,
about 5 times for write and 3 times for read with a block size of 512,
if clustering is possible) and a moderate speedup for the moderatatly
large block sizes that should be used on non-small media (4K is the
best size in most cases, and the speedup for that is about 1.3 times
for write and 1.2 times for read).  mmap() should benefit from clustering
like read()/write(), but the current implementation of vm only supports
clustering (at least for getpages) if the fs block size is >= PAGE SIZE.

msdosfs is now only slightly slower than ffs with soft updates for
writing and slightly faster for reading when both use their best block
sizes.  Writing is slower for msdosfs because of more sync writes.
Reading is faster for msdosfs because indirect blocks interfere with
clustering in ffs.

The changes in msdosfs_read() and msdosfs_write() are simpler merges
of corresponding code in ffs (after fixing some style bugs in ffs).
msdosfs_bmap() needs fs-specific code.  This implementation loops
calling a lower level bmap function to do the hard parts.  This is a
bit inefficient, but is efficient enough since msdsfs_bmap() is only
called when there is physical i/o to do.

Approved by: re (hrs)

16 years agoClean up before implementing vfs clustering for msdosfs:
bde [Fri, 20 Jul 2007 16:21:47 +0000 (16:21 +0000)]
Clean up before implementing vfs clustering for msdosfs:

In msdosfs_read(), mainly reorder the main loop to the same order as in
ffs_read().

In msdosfs_write() and extendfile(), use vfs_bio_clrbuf() instead of
clrbuf().  I think this just just a bogus optimization, but ffs always
does it and msdosfs already did it in one place, and it is what I've
tested.

In msdosfs_write(), merge good bits from a comment in ffs_write(), and
fix 1 style bug.

In the main comment for msdosfs_pcbmap(), improve wording and catch
up with 13 years of changes in the function.  This comment belongs in
VOP_BMAP.9 but that doesn't exist.

In msdosfs_bmap(), return EFBIG if the requested cluster number is out
of bounds instead of blindly truncating it, and fix many style bugs.

Approved by: re (hrs)

16 years agoNew release notes:
bmah [Fri, 20 Jul 2007 15:48:02 +0000 (15:48 +0000)]
New release notes:
ixgb (no manpage)
ISDN4BSD, ng_h4, and netatm disconnected

Modified release note:
ULE (3.0)

Approved by: re (implicitly)

16 years agoIn add_channel(), search 11g channels if mode is AUTO and corresponding
sephe [Fri, 20 Jul 2007 11:38:12 +0000 (11:38 +0000)]
In add_channel(), search 11g channels if mode is AUTO and corresponding
11b channel is not found, e.g. Atheros 5211.

Reported by: matteo
Problem outlined by: thompsa
Reviewed by: sam, thompsa
Approved by: re (kensmith), sam (mentor)
Tested by: matteo (an early version)

16 years agoMake sure we release the control vnode in Coda:
rwatson [Fri, 20 Jul 2007 11:14:51 +0000 (11:14 +0000)]
Make sure we release the control vnode in Coda:

We allocate coda_ctlvp when /coda is mounted, but never release it.
During the unmount this vnode was marked as UNMOUNTING and when venus
is started a second time the system would hang, possibly waiting for
the old vnode to disappear.

So now we call vrele on the control vnode when file system is unmounted
to drop the reference we got during the mount. I'm pretty sure it is
also necessary to not skip the handling in coda_inactive for the control
vnode, it seems like that is the place we actually get rid of the vnode
once the refcount has dropped to 0.

Submitted by: Jan Harkes <jaharkes at cs dot cmu dot edu>
Approved by: re (kensmith)

16 years agottyfree() frees the cdev(). But if there are pending kevents,
kib [Fri, 20 Jul 2007 09:41:54 +0000 (09:41 +0000)]
ttyfree() frees the cdev().  But if there are pending kevents,
filt_ttyrdetach() etc would later attempt to dereference cdev->si_tty,
causing a 0xdeadc0de dereference.  Change kn_hook value from cdev to
struct tty to avoid dereferencing freed cdev.

In ttygone(), wake up select(), sigio and kevent() users in addition
to the queue sleepers.

Return EV_EOF from kevent filters if TS_GONE is set.

Submitted by: peter
Tested by: Peter Holm
Approved by: re (kensmith)
MFC after: 2 weeks

16 years agoFix some problems with lock profiling in rw locks:
attilio [Fri, 20 Jul 2007 08:43:42 +0000 (08:43 +0000)]
Fix some problems with lock profiling in rw locks:
- Adjust lock_profiling stubs semantic in the hard functions in order to be
  more accurate and trustable
- As for sx locks, disable shared paths for lock_profiling.  Actually,
  lock_profiling has a subtle race which makes results caming from shared
  paths not completely trustable. A macro stub (LOCK_PROFILING_SHARED) can
  be actually used for re-enabling this paths, but is currently intended
  for developing use only.
- style(9) fixes

Approved by: jeff, kmacy, jhb[1]
Approved by: re

[1] Had initial reservations not shared by others, conceded
    in the end.

16 years agoi386_set_ioperm, i386_get_ldt and i386_set_ldt are now MPSAFE
attilio [Fri, 20 Jul 2007 08:35:18 +0000 (08:35 +0000)]
i386_set_ioperm, i386_get_ldt and i386_set_ldt are now MPSAFE
(Giant/sched_lock free) so remove unuseful Giant cruft.

Approved by: jeff
Approved by: re
Sponsorized by: NGX Italy (http://www.ngx.it)

16 years agoTwo changes to vm_fault_additional_pages():
alc [Fri, 20 Jul 2007 06:55:11 +0000 (06:55 +0000)]
Two changes to vm_fault_additional_pages():

1. Rewrite the backward scan.  Specifically, reverse the order in which
   pages are allocated so that upon failure it is never necessary to
   free pages that were just allocated.  Moreover, any allocated pages
   can be put to use.  This makes the backward scan behave just like the
   forward scan.

2. Eliminate an explicit, unsynchronized check for low memory before
   calling vm_page_alloc().  It serves no useful purpose.  It is, in
   effect, optimizing the uncommon case at the expense of the common
   case.

Approved by: re (hrs)
MFC after: 3 weeks

16 years agoProtect transaction labels by its own lock to reduce lock contention.
simokawa [Fri, 20 Jul 2007 03:42:57 +0000 (03:42 +0000)]
Protect transaction labels by its own lock to reduce lock contention.

Approved by: re (rwatson)

16 years agoFix a strict aliasing warning from GCC 4.1.
kientzle [Fri, 20 Jul 2007 01:28:50 +0000 (01:28 +0000)]
Fix a strict aliasing warning from GCC 4.1.

Thanks to: Joerg Sonnenberger
Approved by: re (hrs)
MFC after: 3 days

16 years agoFill in some casts that are needed (according to GCC 4.1)
kientzle [Fri, 20 Jul 2007 01:27:50 +0000 (01:27 +0000)]
Fill in some casts that are needed (according to GCC 4.1)

Thanks to: Joerg Sonnenberger
Approved by: re (hrs)
MFC after: 3 days

16 years agoDon't exit immediately on libarchive warnings, just
kientzle [Fri, 20 Jul 2007 01:24:49 +0000 (01:24 +0000)]
Don't exit immediately on libarchive warnings, just
set the delayed return value and keep going.

Approved by: re (hrs)
MFC after: 7 days

16 years agoAdd legacy interrupt handler which would be more appropriate for
yongari [Fri, 20 Jul 2007 00:25:20 +0000 (00:25 +0000)]
Add legacy interrupt handler which would be more appropriate for
interrupt that is shared with other devices(e.g. USB) in system and
provide a new tunable "hw.msk.legacy_intr" to activate the legacy
interrupt handler. Setting the tunable automatically disables MSI
for msk(4). Previously msk(4) used adoptive polling with taskqueue(9)
as all msk(4) hardwares I know supports MSI. However, there are cases
that MSI couldn't be used on some hardwares due to bugs in MSI
implementatins.

Tested by: Li-Lun Wang < llwang AT infor DOT org >
Approved by: re (kensmith)

16 years agoAttempt to improve feature parity between UDPv4 and UDPv6 by merging
rwatson [Thu, 19 Jul 2007 22:34:25 +0000 (22:34 +0000)]
Attempt to improve feature parity between UDPv4 and UDPv6 by merging
UDPv4 features to UDPv6:

- Add MAC checks on delivery and MAC labeling on transmit.
- Check for (and reject) datagrams with destination port 0.
- For multicast delivery, check the source port only if the socket being
  considered as a destination has been connected.
- Implement UDP blackholing based on net.inet.udp.blackhole.
- Add a new ICMPv6 unreachable reply rate limiting category for failed
  delivery attempts and implement rate limiting for UDPv6 (submitted by
  bz).

Approved by: re (kensmith)
Reviewed by: bz

16 years agoUpdate the default FILESYSTEMS value in a comment to note that ext2fs is
jhb [Thu, 19 Jul 2007 21:00:08 +0000 (21:00 +0000)]
Update the default FILESYSTEMS value in a comment to note that ext2fs is
included in the default list in the locate.updatedb script.

Approved by: re (bmah)
Inspired by: mwlucas

16 years ago - Refine the load balancer to improve buildkernel times on dual core
jeff [Thu, 19 Jul 2007 20:03:15 +0000 (20:03 +0000)]
 - Refine the load balancer to improve buildkernel times on dual core
   machines.
 - Leave the long-term load balancer running by default once per second.
 - Enable stealing load from the idle thread only when the remote processor
   has more than two transferable tasks.  Setting this to one further
   improves buildworld.  Setting it higher improves mysql.
 - Remove the bogus pick_zero option.  I had not intended to commit this.
 - Entirely disallow migration for threads with SRQ_YIELDING set.  This
   balances out the extra migration allowed for with the load balancers.
   It also makes pick_pri perform better as I had anticipated.

Tested by: Dmitry Morozovsky <marck@rinet.ru>
Approved by: re

16 years ago - When newtd is specified to sched_switch() it was not being initialized
jeff [Thu, 19 Jul 2007 19:51:45 +0000 (19:51 +0000)]
 - When newtd is specified to sched_switch() it was not being initialized
   properly.  We have to temporarily unlock the TDQ lock so we can lock
   the thread and add it to the run queue.  This is used only for KSE.
 - When we add a thread from the tdq_move() via sched_balance() we need to
   ipi the target if it's sitting in the idle thread or it'll never run.

Reported by: Rene Landan
Approved by: re

16 years agoDocument support for M_NOWAIT by the new implementation of contigmalloc(9)
alc [Thu, 19 Jul 2007 17:23:20 +0000 (17:23 +0000)]
Document support for M_NOWAIT by the new implementation of contigmalloc(9)
in HEAD.

Approved by: re (hrs)
Reviewed by: Michael Plass