Commit graph

55125 commits

Author SHA1 Message Date
John Baldwin 9eda9d7ac5 Add callout_drain()'s to foo_detach() after calling foo_stop() to make sure
that if softclock is running on another CPU and is blocked on our driver
lock, we will wait until it has acquired the lock, seen that it was
cancelled, dropped the lock, and awakened us so that we can safely destroy
the mutex.

MFC after:	3 days
2005-08-17 17:44:32 +00:00
John Baldwin c98ae70c21 Fix locking in el(4) and mark mpsafe.
- Add locked variants of el_init and el_start.
- Don't initialize the mutex and lock it during el_probe().
- Do initialize the mutex during attach.  (el_probe() did destroy the mutex
  to cleanup, so this meant the driver was always using a destroyed mutex
  when it was running.)
- Setup the interrupt handler after ether_ifattach().
- Fix locking in el_detach() and el_ioctl().

Note: Since I couldn't actually find anyone with this hardware, I'm going
ahead and committing these changes so they won't be lost.  I'll remove the
driver in a week (real purpose of the MFC after below) unless someone pipes
up to test this.

MFC after:	1 week
Tested by:	gcc(1)
2005-08-17 17:36:47 +00:00
Hajimu UMEMOTO c219fd0c5e don't raise cpu speed over the value when passive cooling is in
effect.  since CPU speed is restored by degrees, we cannot use
the facility of saving cpu speed by CPUFREQ_set() effectively.
so, we need to save the value when passive cooling is in effect.

Repoeted by:	Kevin Oberman <oberman__at__es.net>
2005-08-17 17:01:25 +00:00
Hajimu UMEMOTO 5d52565396 - fix race condition using sx lock.
- use TAILQ_FOREACH() for readability.

Suggested by:	jhb
2005-08-17 16:46:55 +00:00
Pawel Jakub Dawidek dddd1d537a Always run dedicated kernel thread (even when we have hardware support).
There is no performance impact, but allows to allocate memory with
M_WAITOK flag.
As a side effect this simplify code a bit.

MFC after:	3 days
2005-08-17 15:25:57 +00:00
Pawel Jakub Dawidek bf71eaacf1 We should now return 0. 2005-08-17 15:12:34 +00:00
Søren Schmidt 85047b1b0c Add support for working around controllers that cannot do DMA in 48bit mode.
The workaround use PIO mode above ~137GB to allow using the disk.
Add the Acer chips with rev < 0xc4 as first candidate.
2005-08-17 15:00:33 +00:00
Søren Schmidt fb235b243c Use the bio field instead of the driver field as intended. 2005-08-17 14:50:18 +00:00
John Baldwin f68d1644f8 Use device_printf() and if_printf() and remove ste_unit from the softc. 2005-08-17 14:37:39 +00:00
Pawel Jakub Dawidek d1dca8a818 Even if crypto_dispatch() return an error, request is not canceled and
our callback will still be called, just to tell us that requested
failed...

Reported by:	Mike Tancsa <mike@sentex.net>
MFC after:	3 days
2005-08-17 14:34:52 +00:00
John Baldwin 45f3f78ced Catch up to ic_curchan changes by making the same change here that was made
in ipw(4) in the earlier ic_curchan mega commit.

Submitted by:	Øyvind Kolbu oyvind at kolbu dot ws
Tested by:	Stefan Ehmann shoesoft at gmx dot net
2005-08-17 14:08:52 +00:00
Pawel Jakub Dawidek 2be2b2eab5 We don't need to clear allocated memory. This will speed-up things a bit.
MFC after:	3 days
2005-08-17 14:08:50 +00:00
Ian Dowse 65ed954554 In the ufsdirhash_build() failure case for corrupted directories
or unreadable blocks, make sure to destroy the mutex we created.
Also fix an unrelated typo in a comment.

Found by:	Peter Holm's stress tests
Reviewed by:	dwmalone
MFC after:	3 days
2005-08-17 08:48:42 +00:00
Poul-Henning Kamp 516ad423b1 Handle device drivers with D_NEEDGIANT in a way which does not
penalize the 'good' drivers:  Allocate a shadow cdevsw and populate
it with wrapper functions which grab Giant
2005-08-17 08:19:52 +00:00
Pawel Jakub Dawidek 12e755355b Assert proper key size also in userland by defining KASSERT in !_KERNEL case. 2005-08-17 07:59:07 +00:00
Poul-Henning Kamp a07b0febaa In vop_stdpathconf(ap) also default for _PC_NAME_MAX and _PC_PATH_MAX. 2005-08-17 06:59:23 +00:00
Christian S.J. Peron 8677689134 Ensure that file flags such as schg, sappnd (and others) are honored
by md(4). Before this change, it was possible to by-pass these flags
by creating memory disks which used a file as a backing store and
writing to the device.

This was discussed by the security team, and although this is problematic,
it was decided that it was not critical as we never guarantee that root will
be restricted.

This change implements the following behavior changes:

-If the user specifies the readonly flag, unset write operations before
 opening the file. If the FWRITE mask is unset, the device will be
 created with the MD_READONLY mask set. (readonly)
-Add a check in g_md_access which checks to see if the MD_READONLY mask
 is set, if so return EROFS
-Do not gracefully downgrade access modes without telling the user. Instead
 make the user specify their intentions for the device (assuming the file is
 read only). This seems like the more correct way to handle things.

This is a RELENG_6 candidate.

PR:		kern/84635
Reviewed by:	phk
2005-08-17 01:24:55 +00:00
Colin Percival 751a4770f7 Unbreak the world build (in sbin/gbde). This file is used by both
kernel and world, so KASSERT() needs to be wrapped within an #ifdef
_KERNEL / #endif pair.

Reported by:	krion, tinderbox
2005-08-17 00:24:20 +00:00
John Baldwin ca5fc32d02 Fixup locking in if_my(4) and mark it MPSAFE:
- Add locked variants of my_start() and my_init().
- Assert that the lock is held in several places rather than recursing.
- Overhaul failure case handling in my_attach() so that it will actually
  clean up completely in each of the failure cases.
- Setup the interrupt after ether_ifattach() in my_attach().
- Remove unused callout handle from softc.
- Free the metadata for the descriptors my_in detach() (we leaked it
  before).
- Fix locking in my_ioctl().
- Remove spls.

Tested by:	brueffer
MFC after:	3 days
2005-08-16 20:39:30 +00:00
Poul-Henning Kamp 52d71e1a85 remove stale comments 2005-08-16 20:03:29 +00:00
Hajimu UMEMOTO 961f7f911f Save cpu level only when priority is greater than PRIO_USER
to make CPUFREQ_SET(NULL, prio) work.
TODO: implement saved_level as stack.

Reviewed by:	njl
2005-08-16 20:03:08 +00:00
Hajimu UMEMOTO 1c44678637 avoid exclusive sleep mutex. 2005-08-16 19:49:10 +00:00
Poul-Henning Kamp b3740d656f Remove stale comment. 2005-08-16 19:47:42 +00:00
Poul-Henning Kamp 31cc57cdbd Collect the devfs related sysctls in one place 2005-08-16 19:25:02 +00:00
Poul-Henning Kamp 9c0af1310c Create a new internal .h file to communicate very private stuff
from kern_conf.c to devfs.

For now just two prototypes, more to come.
2005-08-16 19:08:01 +00:00
Pawel Jakub Dawidek 36c51ae068 Check key size for rijndael, as invalid key size can lead to kernel panic.
It checked other algorithms against this bug and it seems they aren't
affected.

Reported by:	Mike Tancsa <mike@sentex.net>
PR:		i386/84860
Reviewed by:	phk, cperciva(x2)
2005-08-16 18:59:00 +00:00
John Baldwin 207377b25e Clarify a comment. 2005-08-16 18:15:17 +00:00
Brooks Davis 7cf30146f0 - Move IF_ADDR_LOCK_DESTROY(ifp) from if_free to if_free_type.
- Add a note that additions should be made to if_free_type and not
  if_free to help avoid this in the future.

This apparently fixes a use after free in if_bridge and may fix bugs
in other direct if_free_type consumers.

Reported by:	thompsa
2005-08-16 17:02:35 +00:00
Lukas Ertl 664a97517f Make it possible to remove stale, left-over subdisks. 2005-08-16 15:12:44 +00:00
Peter Grehan 1f0baa8e5f Remove unnecessary and alarming printf.
MFC after:  1 day
2005-08-16 02:38:02 +00:00
Marius Strobl 4571e2104f Now that at least some screen savers work on sparc64 sync with other
archs and enable splash(4) by default (the non-working screen savers
either don't compile or just have no effect when loaded, i.e. don't
cause harm).

MFC after:	1 week
2005-08-15 21:15:07 +00:00
Marius Strobl 1b279bfb52 - Change the code that determines whether to use a serial console and
which serial device to use in that case respectively to not rely on
  the OFW names of the input/output and stdin/stdout devices. Instead
  check whether input and output refers to the same device and is of
  type serial (uart(4) was already doing this) and for the fallback
  to a serial console in case a keyboard is the selected input device
  but unplugged do the same for stdin and stdout in case the input
  device is nonexistent (PS/2 and USB keyboards) or has a 'keyboard'
  property (RS232 keyboards). Additionally also check whether the OFW
  did a fallback to a serial console in the same way in case the
  output device is nonexistent. While at it save on some variables
  and for sys/boot/sparc64/loader/metadata.c move the code in question
  to a new function md_bootserial() so it can be kept in sync with
  uart_cpu_getdev_console() more easily.
  This fixes selecting a serial console and the appropriate device
  when using a device path for the 'input-device' and 'output-device'
  OFW environment variables instead of an alias for the serial device
  to use or when using a screen alias that additionally denotes a
  video mode (like e.g. 'screen:r1024x768x60') but no keyboard is
  plugged in (amongst others). It also makes the code select a serial
  console in case the OFW did the same due to a misconfiguration like
  both 'input-device' and 'output-device' set to 'keyboard' or to a
  nonexisting device (whether the OFW does a fallback to a serial
  console in case of a misconfiguration or one ends up with just no
  console at all highly depends on the OBP version however).
- Reduce the size of buffers that only ever need to hold the string
  'serial' accordingly. Double the size of buffers that may need to
  hold a device path as e.g. '/pci@8,700000/ebus@5/serial@1,400000:a'
  exceeds 32 chars.
- Remove the package handle of the '/options' node from the argument
  list of uart_cpu_getdev_dbgport() as it's unused there and future
  use is also unlikely.

MFC after:	1 week
2005-08-15 20:58:36 +00:00
Brooks Davis f3447eb493 Vlan interfaces change their type after ether_ifattach() so we needs to
use if_free_type(ifp, IFT_ETHER) to delete them and stop leaking struct
arpcoms.

Reported by:	thompsa
MFC After:	3 days
2005-08-15 20:27:34 +00:00
Poul-Henning Kamp d785dfefa4 Eliminate effectively unused dm_basedir field from devfs_mount. 2005-08-15 19:40:53 +00:00
Warner Losh 1dd467ac95 Some preliminary support for Megahertz XJEM and CCEM (same cards really)
combo cards.
2005-08-15 18:28:49 +00:00
Warner Losh dfad9073ad Diff reduction to my tree: commit the trivial part of efforts to add
support for the really old Megahertz ethernet/modem combo cards.
2005-08-15 17:20:34 +00:00
Lukas Ertl 8cc5eb98ad Fix a stupid logic bug introduced in geom_vinum_drive.c rev 1.18:
When a drive is newly created, it's state is initially set to 'down',
so it won't allow saving the config to it (thus it will never know of
itself being created).  Work around this by adding a new flag, that's
also checked when saving the config to a drive.
2005-08-15 17:07:47 +00:00
Andrew Thompson 691cdb5351 Ensure that we are holding the lock when initialising the bridge interface. We
could initialise while unlocked if the bridge is not up when setting the inet
address, ether_ioctl() would call bridge_init.

Change it so bridge_init is always called unlocked and then locks before
calling bstp_initialization().

Reported by:    Michal Mertl
Approved by:    mlaier (mentor)
MFC after:      3 days
2005-08-15 02:54:29 +00:00
Andrew Thompson a1c0fd4dee Ensure that we are holding the lock when initialising the bridge interface. We
could initialise while unlocked if the bridge is not up when setting the inet
address, ether_ioctl() would call bridge_init.

Change it so bridge_init is always called unlocked and then locks before
calling bstp_initialization().

Reported by:	Michal Mertl
Approved by:	mlaier (mentor)
MFC after:	3 days
2005-08-15 02:50:13 +00:00
Marcel Moolenaar d41a7ed490 Remove the execute permission for stacks. 2005-08-14 23:17:59 +00:00
Alan Cox 96e5109430 Simplify the page table page reference counting by pmap_enter()'s change of
mapping case.

Eliminate a stale comment from pmap_enter().

Reviewed by:	tegge
2005-08-14 20:02:50 +00:00
Bjoern A. Zeeb bd2e5495d1 Fix broken build of rev. 1.108 in case of no INET6 and IPFIREWALL
compiled into kernel.

Spotted and tested by:	Michal Mertl <mime at traveller.cz>
2005-08-14 18:20:33 +00:00
Alexander Kabaev 0c207975f2 Do not keep parent directory locked while calling VFS_ROOT to traverse mount
points in lookup(). The lock can be dropped safely around VFS_ROOT because
LOCKPARENT semantics with child and perent vnodes coming from different FSes
does not really have any meaningful use. On the other hard, this prevents
easily triggered deadlock on systems using automounter daemon.
2005-08-14 18:10:04 +00:00
Peter Grehan 14dcd40fde - restore the ability to mount cd9660 filesystems as root by inverting
some of the options test, specifically the joliet and rockridge tests.
  Since the root mount callchain doesn't go through cd9660_cmount, the
  default mount options aren't set. Rather than having the main codepath
  assume the options are there, test for the absence of the inverted
  optioin

  e.g. instead of vfs_flagopt(.. "joliet" ..), test for
  !vfs_flagopt(.. "nojoliet" ..)

  This works for root mount, non-root mount and future nmount cases.

- in cd9660_cmount, remove inadvertent setting of "gens" when "extatt"
  was set.

Reported by:	grehan, Dario Freni <saturnero at freesbie org>
Tested by:	Dario Freni
Not objected to by:	phk

MFC after:	3 days
2005-08-14 04:19:36 +00:00
Robert Watson 5554b8cc3e Bump __FreeBSD_version for dev_clone eventhandler to add credential. 2005-08-13 21:26:53 +00:00
Marcel Moolenaar a812f8435a o s/pmap_lpte_/pmap_/g
o  Remove pmap_is_referenced(). It was already compiled-out.
2005-08-13 21:16:38 +00:00
Marcel Moolenaar 86257f240a Fix the problem with the IPI for the lazy context switching of the
high FP registers. It was not that the IPI got lost due to the
perceived unreliability of the IPI delivery, but rather that the
IPI was not assigned a vector (ugh). Sending a 0 vector to a CPU
results in a stray external interrupt.
Add a KASSERT to ipi_send() to catch this. The initialization of
the IPIs could be better, but it's not at all sure what the future
of the code is. Avoid wasting a lot of time on something that is
going to be rewritten anyway.
2005-08-13 21:08:32 +00:00
Alexander Kabaev 857b66d505 Do not use vm_pager_init() to initialize vnode_pbuf_freecnt variable.
vm_pager_init() is run before required nswbuf variable has been set
to correct value. This caused system to run with single pbuf available
for vnode_pager. Handle both cluster_pbuf_freecnt and vnode_pbuf_freecnt
variable in the same way.

Reported by:	ade
Obtained from:	alc
MFC after:	2 days
2005-08-13 20:21:33 +00:00
Marcel Moolenaar fd65baf8e2 Make mpsafe_vfs=1 the default on ia64. 2005-08-13 20:07:50 +00:00
Hajimu UMEMOTO 5af09736a8 added a knob to enable path MTU discovery for multicast packets.
(by default, it is disabled)

Submitted by:	suz
Obtained from:	KAME
2005-08-13 19:55:06 +00:00