dragonfly.git
13 years agoMP table related static function renaming
Michael Neumann [Sat, 2 Oct 2010 16:03:35 +0000 (18:03 +0200)]
MP table related static function renaming

Apply commit 3aba8f737c990853a6105e77cfb2bcae59b217f8 for x86_x64.

13 years agoGet rid of global variable 'boot_cpu_id'
Michael Neumann [Sat, 2 Oct 2010 15:49:35 +0000 (17:49 +0200)]
Get rid of global variable 'boot_cpu_id'

Apply commit bd8aa7e222aa89ca27a5fe2e660f02ff942abb48 for x86_64.

13 years agoCorrect mptable_pass[12]() function comment
Michael Neumann [Sat, 2 Oct 2010 15:45:39 +0000 (17:45 +0200)]
Correct mptable_pass[12]() function comment

Apply commit 0ae734b516f9975fd3ebfddd3748a028456668b6 for x86_64.

13 years agomp_probe() -> mptable_probe()
Michael Neumann [Sat, 2 Oct 2010 15:42:10 +0000 (17:42 +0200)]
mp_probe() -> mptable_probe()

Apply commit cb00b5c4169432285c3acafc0e568ffba6a63d6e for x86_64.

13 years agoChange mptable mapping mechanism during mptable parsing.
Michael Neumann [Sat, 2 Oct 2010 15:39:10 +0000 (17:39 +0200)]
Change mptable mapping mechanism during mptable parsing.

Apply commit 981bebd11ba5507ab5887bb66ef52935ab350bed for x86_64.

13 years agomp_probe(): Return physical address of the MP float pointer struct
Michael Neumann [Sat, 2 Oct 2010 14:21:33 +0000 (16:21 +0200)]
mp_probe(): Return physical address of the MP float pointer struct

Apply commit aeb48299996ead8f1c328436e93b1836326c2bf6 for x86_64.

13 years agoRemove unused variable.
Michael Neumann [Sat, 2 Oct 2010 14:14:46 +0000 (16:14 +0200)]
Remove unused variable.

13 years agoReorder MP probing
Michael Neumann [Sat, 2 Oct 2010 14:13:50 +0000 (16:13 +0200)]
Reorder MP probing

Apply commit 0f85efa20adbc0f9062a269bc2a7653b7b646683 for x86_64.

13 years agoDefer mptable_pass1() from mp_probe() to mp_enable()
Michael Neumann [Sat, 2 Oct 2010 14:02:47 +0000 (16:02 +0200)]
Defer mptable_pass1() from mp_probe() to mp_enable()

Apply commit f9c3b04f0dd9dd75702357d2bc8de782280c41df for x86_64.

13 years agoSave EBDA address before mp_probe()
Michael Neumann [Sat, 2 Oct 2010 13:55:56 +0000 (15:55 +0200)]
Save EBDA address before mp_probe()

Apply commit 1876681aa52fc75e5ac4945d4e316b2bff8b2aed for x86_64.

13 years agomptable_pass1: Don't set ncpus to 1; it has already been setup.
Michael Neumann [Sat, 2 Oct 2010 13:49:45 +0000 (15:49 +0200)]
mptable_pass1: Don't set ncpus to 1; it has already been setup.

Apply commit bcf5ecdc02ba0af44b1d9b635393a27234d67b27 for x86_64.

13 years agoRemove mp_capable; mp_enable() uses cpu_apic_address.
Michael Neumann [Sat, 2 Oct 2010 13:47:23 +0000 (15:47 +0200)]
Remove mp_capable; mp_enable() uses cpu_apic_address.

Apply commit 50bc991ed5b5f45c656530ebf5fc8b44f24258ed for x86_64.

13 years agoDefer LAPIC checking from pmap_bootstrap() to mp_enable()
Michael Neumann [Sat, 2 Oct 2010 13:40:59 +0000 (15:40 +0200)]
Defer LAPIC checking from pmap_bootstrap() to mp_enable()

Similar to commit 8b5fcfe2eabb8f50c8211d71788097cd4bfd98ba

13 years agoinstaller: Utilize dumpon(8) and swapoff(8) to turn off dump and swap.
Sascha Wildner [Thu, 23 Sep 2010 09:43:06 +0000 (11:43 +0200)]
installer: Utilize dumpon(8) and swapoff(8) to turn off dump and swap.

Previously, the installer would block further installation attempts
once a swap was mounted. This was very inconvenient, e.g. when trying
to do multiple installs in one session.

It also never issued a 'dumpon off' causing dumping to be enabled
until rebooting. This caused issues upon reboot when a removable disk
(eSATA, for example) was unplugged before the reboot.

Now that we have swapoff(8), fix all these issues by turning off
dumping and swapping once the installation is completed (after
unmounting). Also, do this in a number of other places (where we
previously warned) to make sure it all gets deactivated again should
the user have cancelled a previous installation.

13 years agokernel - Fix bug in recent AHCI driver adjustment
Matthew Dillon [Thu, 23 Sep 2010 03:05:23 +0000 (20:05 -0700)]
kernel - Fix bug in recent AHCI driver adjustment

* The recent adjustment of the driver to help deal with breakage in the
  newer AMD chipsets also failed to check for pending commands after
  a normal completion.  Fix the brainfart.

13 years agokernel - unlock the syscons_lock spinlock around ttwakeup()
Matthew Dillon [Thu, 23 Sep 2010 02:14:24 +0000 (19:14 -0700)]
kernel - unlock the syscons_lock spinlock around ttwakeup()

* ttwakeup() can block, we have to unlock syscons_lock() before calling it.

13 years agokernel - Enable EVFILT_WRITE for /dev/null, /dev/zero, etc
Matthew Dillon [Thu, 23 Sep 2010 01:00:03 +0000 (18:00 -0700)]
kernel - Enable EVFILT_WRITE for /dev/null, /dev/zero, etc

* Make both read and write kqfilters valid instead of just the read filter.
  This fixes issues with programs which select on stdout for writing,
  e.g. 'ssh -n "blah" > /dev/null'.

13 years agobuild - Workaround LINT issues
Matthew Dillon [Wed, 22 Sep 2010 21:58:53 +0000 (14:58 -0700)]
build - Workaround LINT issues

* Use an intermediate uint32_t variable to store a uint8_t length to avoid
  a silly gcc warning-turned-error about a comparison always being true.

Reported-by: swildner
13 years agoinstaller: Move /usr/pkg commands where they belong.
Sascha Wildner [Wed, 22 Sep 2010 19:32:24 +0000 (21:32 +0200)]
installer: Move /usr/pkg commands where they belong.

13 years agogcc44: Fix mis-usage of ||.
Sascha Wildner [Wed, 22 Sep 2010 18:16:26 +0000 (20:16 +0200)]
gcc44: Fix mis-usage of ||.

13 years agokernel - Remove some debugging kprintfs
Matthew Dillon [Wed, 22 Sep 2010 16:23:57 +0000 (09:23 -0700)]
kernel - Remove some debugging kprintfs

* gone: Warning: vfsync_bp skipping dirty buffer 0x********

* gone: Warning: delete stale syncache for tp=0x********, sc=*

Pointers *'d out to protect their identities!

13 years agoun-tokenize savers
Alex Hornung [Wed, 22 Sep 2010 10:55:48 +0000 (11:55 +0100)]
un-tokenize savers

* Un-tokenize all savers again. We can't simply tokenize around vidsw[]
  that easily because the saver functions are called from the console
  paths, too (cnputc, ...)

* Regarding vidsw we'll eventually have to find a different solution to
  lock it up. The current approach can't work.

Reported-by: Sascha Wildner (swildner@)
13 years agoinstaller: Remove some unused code.
Sascha Wildner [Tue, 21 Sep 2010 21:19:24 +0000 (23:19 +0200)]
installer: Remove some unused code.

13 years agoMove test/debug/gdb.kernel to share/misc/gdbinit.
Sascha Wildner [Wed, 22 Sep 2010 09:56:06 +0000 (11:56 +0200)]
Move test/debug/gdb.kernel to share/misc/gdbinit.

The main reason is that crashinfo(8) was previously searching for
this script in /usr/src because it wasn't installed in the system.

This led to two little problems. First, if you didn't have source
in /usr/src, the core.xy.txt file wouldn't have all the information.
Second, if you had source in /usr/src but it was outdated and didn't
have all the commands that crashinfo(8) required, you would get
unwanted errors in core.xy.txt.

Therefore, put the file in share/misc from where it will get
installed and where other initialization files such as indent.pro
also reside. The user can then copy it to ~/.gdbinit as he likes.

13 years agonetwork - Fix PF mis-handling and other bugs
Matthew Dillon [Wed, 22 Sep 2010 07:09:31 +0000 (00:09 -0700)]
network - Fix PF mis-handling and other bugs

* Header file changes for last PF commit.

13 years agonetwork - Fix PF mis-handling and other bugs
Matthew Dillon [Wed, 22 Sep 2010 07:01:08 +0000 (00:01 -0700)]
network - Fix PF mis-handling and other bugs

* The mbuf subsystem does NOT clear pkthdr.pf.* fields on mbuf allocation.
  PF was assuming that pf.flags was being cleared.  Instead move the
  PF_TAG_GENERATED flag from pf.flags to fw_flags and call it PF_MBUF_TAGGED.
  The fw_flags field is cleared by the mbuf subsystem.

  Then clear pf.flags whenever we set PF_MBUF_TAGGED or determine that it
  has not been set.

  This fixes a serious bug where the PF filters start missing packets,
  increasing from system boot.  This is because more and more packets in
  the objcache wind up with non-zero pf.flags which cause PF to pass
  the packet unconditionally.

  For example NAT packets would wind up in the normal protocol stack which
  would of course would get confused and generate a RST.

* Move the 'cur' static pointer in pf_purge_expired_states() up a bit
  so pf_free_state() can access it and rename it 'purge_cur'.

  Adjust pf_free_state() to iterate purge_cur when it matches the state
  being destroyed.

* Protect the pf_purge_thread() with pf_token, it was depending on the MP
  lock before which definitely does not do the job.

* Flag the pfil hook as being MPSAFE.

Reported-by: "Jan Lentfer" <Jan.Lentfer@web.de>
13 years agolibc - nmalloc: Continue in a do/while(0) loop exits the loop, making the mtmagazine...
Venkatesh Srinivas [Tue, 21 Sep 2010 04:59:48 +0000 (21:59 -0700)]
libc - nmalloc: Continue in a do/while(0) loop exits the loop, making the mtmagazine routines not use the previous magazine.

Also handle null return from _vmem_alloc in burst allocation path.

Found-by: dillon
13 years agoboot: Remove duplicate optcd kernel
Michael Neumann [Mon, 20 Sep 2010 22:56:57 +0000 (00:56 +0200)]
boot: Remove duplicate optcd kernel

13 years agoMerge branch 'master' of /home/www-data/gitweb/dragonfly
Peter Avalos [Mon, 20 Sep 2010 22:02:47 +0000 (12:02 -1000)]
Merge branch 'master' of /home/www-data/gitweb/dragonfly

13 years agoRemove an include file (leftover from the iic upgrade).
Sascha Wildner [Mon, 20 Sep 2010 21:56:57 +0000 (23:56 +0200)]
Remove an include file (leftover from the iic upgrade).

13 years agoMerge branch 'vendor/BZIP'
Peter Avalos [Mon, 20 Sep 2010 21:35:14 +0000 (11:35 -1000)]
Merge branch 'vendor/BZIP'

13 years agoImport bzip2-1.0.6 which fixes CVE-2010-0405. avalon/vendor/BZIP
Peter Avalos [Mon, 20 Sep 2010 21:34:25 +0000 (11:34 -1000)]
Import bzip2-1.0.6 which fixes CVE-2010-0405.

13 years agobzip2: Remove tests from Makefile.
Peter Avalos [Mon, 20 Sep 2010 21:25:15 +0000 (11:25 -1000)]
bzip2: Remove tests from Makefile.

The files were already removed 5 years ago, so the test target would
have never worked.

13 years agoMerge branch 'vendor/BZIP'
Peter Avalos [Mon, 20 Sep 2010 21:22:15 +0000 (11:22 -1000)]
Merge branch 'vendor/BZIP'

13 years agoUnversion the contrib/bzip2/ directory.
Peter Avalos [Mon, 20 Sep 2010 21:11:30 +0000 (11:11 -1000)]
Unversion the contrib/bzip2/ directory.

13 years agobzip2: Remove regression tests.
Peter Avalos [Mon, 20 Sep 2010 21:03:42 +0000 (11:03 -1000)]
bzip2:  Remove regression tests.

These were removed on master years ago, but never removed from the
vendor branch.

13 years agoaltq(4): Oops, actually remove the #ident (forgot in last commit).
Sascha Wildner [Mon, 20 Sep 2010 20:10:14 +0000 (22:10 +0200)]
altq(4): Oops, actually remove the #ident (forgot in last commit).

13 years agokernel: Fix some operator precedence bugs.
Sascha Wildner [Mon, 20 Sep 2010 20:01:57 +0000 (22:01 +0200)]
kernel: Fix some operator precedence bugs.

13 years agonfs(4): ERROROUT already assigns error.
Sascha Wildner [Mon, 20 Sep 2010 20:00:21 +0000 (22:00 +0200)]
nfs(4): ERROROUT already assigns error.

13 years agokernel: Remove some #ident.
Sascha Wildner [Mon, 20 Sep 2010 18:38:52 +0000 (20:38 +0200)]
kernel: Remove some #ident.

13 years agonetwork - Increase MSIZE to 512
Matthew Dillon [Mon, 20 Sep 2010 19:54:43 +0000 (12:54 -0700)]
network - Increase MSIZE to 512

* The basic problem with 384 is that kmalloc() may hand back a buffer
  which crosses a page boundary, which gums up the DMA engines for
  numerous drivers.  Many drivers can only handle one segment per
  mbuf and even those that can handle more sometimes have fairly low
  segment count limits.

Reported-by: Jan Lentfer <Jan.Lentfer@web.de>
13 years agowpi - Fix some race conditions in variable initializers.
Joe Talbott [Fri, 17 Sep 2010 01:30:44 +0000 (21:30 -0400)]
wpi - Fix some race conditions in variable initializers.

13 years agokernel - Remove mistaken commit of SATA PM spec pdf
Matthew Dillon [Mon, 20 Sep 2010 16:57:16 +0000 (09:57 -0700)]
kernel - Remove mistaken commit of SATA PM spec pdf

13 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Mon, 20 Sep 2010 15:55:55 +0000 (08:55 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

13 years agotruss - Add functions for x86_64 architecture.
Antonio Huete Jimenez [Sun, 19 Sep 2010 11:03:05 +0000 (13:03 +0200)]
truss - Add functions for x86_64 architecture.

Taken-from: FreeBSD

13 years agotruss - Group some globals into a struct.
Antonio Huete Jimenez [Sun, 19 Sep 2010 00:44:12 +0000 (02:44 +0200)]
truss - Group some globals into a struct.

Taken-from: FreeBSD

13 years agotruss - Adapt to the new ELF naming.
Antonio Huete Jimenez [Tue, 14 Sep 2010 22:42:28 +0000 (00:42 +0200)]
truss - Adapt to the new ELF naming.

13 years agoelf - Fill sv_name with the appropiate value for each arch.
Antonio Huete Jimenez [Sun, 5 Sep 2010 18:45:53 +0000 (20:45 +0200)]
elf - Fill sv_name with the appropiate value for each arch.

13 years agorc: Fix startup scripts when command_interpreter is used
Michael Neumann [Mon, 20 Sep 2010 13:27:03 +0000 (15:27 +0200)]
rc: Fix startup scripts when command_interpreter is used

Correct the behaviour when using command_interpreter in
rc.d scripts where the proctitle of ps does not include
the full interpreter path, but for example just "perl: ..."
instead of "/usr/pkg/bin/perl -flags ...".

With this patch, the /etc/rc.d/postgrey stop/status script
of pkgsrc package mail/postgrey works. Other packages seem
to not use command_interpreter at all.

13 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Michael Neumann [Mon, 20 Sep 2010 13:19:30 +0000 (15:19 +0200)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

13 years agoboot: Minor loader prompt fix
Michael Neumann [Mon, 20 Sep 2010 13:11:43 +0000 (15:11 +0200)]
boot: Minor loader prompt fix

When escaping to the loader prompt and typing "load", the
loader was not able to find the "acpi" and other modules
enabled by default. Now it does.

Discussed-with: dillon

13 years agoRevert "gcc41: Remove __DragonFly_cc_version from the spec (no longer needed)."
Sascha Wildner [Mon, 20 Sep 2010 11:39:57 +0000 (13:39 +0200)]
Revert "gcc41: Remove __DragonFly_cc_version from the spec (no longer needed)."

This reverts commit d7d1ed63ea30a9779ecddd4fc91be4052849051f.

We do not want to break building older source (2.6 e.g.) with a current gcc41.

13 years agogcc41: Remove __DragonFly_cc_version from the spec (no longer needed).
Sascha Wildner [Mon, 20 Sep 2010 11:31:30 +0000 (13:31 +0200)]
gcc41: Remove __DragonFly_cc_version from the spec (no longer needed).

13 years agofirewire(4): Fix a gcc44 build error.
Sascha Wildner [Mon, 20 Sep 2010 11:30:27 +0000 (13:30 +0200)]
firewire(4): Fix a gcc44 build error.

Use __DragonFly_version, just like FreeBSD uses __FreeBSD_version.

Reported-by: vsrinivas
13 years agodma - Cast correctly to uintmax_t when using %PRIxMAX
Matthias Schmidt [Mon, 20 Sep 2010 08:59:36 +0000 (10:59 +0200)]
dma - Cast correctly to uintmax_t when using %PRIxMAX

Author: Peter Pentchev <roam@ringlet.net>

13 years agodma - Randomize the retry timeouts a bit
Matthias Schmidt [Mon, 20 Sep 2010 08:51:24 +0000 (10:51 +0200)]
dma - Randomize the retry timeouts a bit

Author: Peter Pentchev <roam@ringlet.net>

13 years agodma - Fix a crash when the SMTP server does not support STARTTLS
Matthias Schmidt [Mon, 20 Sep 2010 08:50:25 +0000 (10:50 +0200)]
dma - Fix a crash when the SMTP server does not support STARTTLS

Author: Peter Pentchev <roam@ringlet.net>

13 years agodma - Honor LDFLAGS if specified in the environment
Matthias Schmidt [Mon, 20 Sep 2010 08:35:13 +0000 (10:35 +0200)]
dma - Honor LDFLAGS if specified in the environment

Author: Peter Pentchev <roam@ringlet.net>

13 years agodma - Check the parsed recipient address for validity
Matthias Schmidt [Mon, 20 Sep 2010 08:34:12 +0000 (10:34 +0200)]
dma - Check the parsed recipient address for validity

Author: Peter Pentchev <roam@ringlet.net>

13 years agoboot - Automatically cd into /boot/kernel when escaping to loader prompt
Matthew Dillon [Sun, 19 Sep 2010 19:58:19 +0000 (12:58 -0700)]
boot - Automatically cd into /boot/kernel when escaping to loader prompt

* Automatically place ourselves in the default kernel directory when
  escaping to the loader prompt to make things more convenient for the
  user.

Submitted-by: Michael Neumann <mneumann@ntecs.de>
13 years agokernel - Report more AHCI revs in the switch
Matthew Dillon [Sun, 19 Sep 2010 17:24:26 +0000 (10:24 -0700)]
kernel - Report more AHCI revs in the switch

* Add some more AHCI revs to the switch so it doesn't report
  'Uknown revision'.  This is purely cosmetic.

Reported-by: "Edward O'Callaghan" <eocallaghan@auroraux.org>
13 years agoacpi - Fix for issue1846
Matthew Dillon [Sun, 19 Sep 2010 17:11:51 +0000 (10:11 -0700)]
acpi - Fix for issue1846

* Bring in a fix for the "ec" panic on boot issue from acpica-unix-20100806.

Submitted-by: "Edward O'Callaghan" <eocallaghan@auroraux.org>
13 years agokernel - Correct bug in malloc_type ks_memuse/ks_inuse management
Matthew Dillon [Sun, 19 Sep 2010 16:43:09 +0000 (09:43 -0700)]
kernel - Correct bug in malloc_type ks_memuse/ks_inuse management

* The new kfree() was improperly adjust ks_memuse/ks_inuse for the wrong
  cpu, leading to MP races which could cause the memory statistics to go
  negative and trigger a panic.

* When calculating loosememuse it is possible to race another cpu and
  come up with an incorrect value.  The race itself is ok, loosememuse
  is not supposed to be 100% deterministic, but even so do not allow
  the value to underflow or we will wind up asserting.

13 years agobuild - Minor build issues
Matthew Dillon [Sun, 19 Sep 2010 15:56:06 +0000 (08:56 -0700)]
build - Minor build issues

* Bring test/debug/vnodeinfo.c up-to-date.

* Adjust test/vkernel/Makefile to properly copy the kernel from the new
  boot location ($root/boot/kernel/kernel).

13 years agokernel - cleanup and some KTR work for x86_64
Matthew Dillon [Sun, 19 Sep 2010 15:54:37 +0000 (08:54 -0700)]
kernel - cleanup and some KTR work for x86_64

* Make the KTR option compile for x86_64 builds.  It's very expensive still
  and not recommended due to the way x86_64 handles va_args.

* On the userland side do not attempt vprintf the va_args yet in the
  ktrdump code, right now it just crashes.

* Cleanup some kprintfs

13 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sun, 19 Sep 2010 15:52:04 +0000 (08:52 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

13 years agoips.4: Use the correct section number.
Sascha Wildner [Sun, 19 Sep 2010 15:47:50 +0000 (17:47 +0200)]
ips.4: Use the correct section number.

13 years agoudevd.8: Fix .Dd
Sascha Wildner [Sun, 19 Sep 2010 15:47:32 +0000 (17:47 +0200)]
udevd.8: Fix .Dd

13 years agomutex.9: Fix typos in two function names.
Sascha Wildner [Sun, 19 Sep 2010 15:47:06 +0000 (17:47 +0200)]
mutex.9: Fix typos in two function names.

13 years agokernel - Attempt to fix two out-of-order read MP races
Matthew Dillon [Sun, 19 Sep 2010 15:36:16 +0000 (08:36 -0700)]
kernel - Attempt to fix two out-of-order read MP races

* Example of issue during buildworld -j 8 loop tests, cc1 occassionally
  fails after upwards of a trillion instructions worth of testing:

  Sep 18 07:11:58 test29 kernel: seg-fault accessing address 0
 rip=0x584ef7 pid=30229 p_comm=cc1

  In this example gdb'ing cc1 and examining the code revealed an impossible
  crash case where off(%ebx) was deterministically accessed a few
  instructions before, then accessed again and somehow %ebx had become zero.

  Unfortunately I could find no smoking gun, but my conjecture is that it
  is a MP race which can occur when the thread migrates between cpus and/or
  a mis-handled IPI.

* In the LWKT messaging code move the cpu_mfence() call in the sequence,
  from rindex->read_args->MFENCE->call to rindex->MFENCE->read_args->call.

* In the LWKT thread acquisition code (for thread migration between cpus),
  add a cpu_mfence() call after the td_flags check indicates success,
  instead of inside the loop where we are waiting for the flags check to
  indicate success.

* In both cases the issue seems to be out-of-order reads and/or speculative
  reads.  Even though MP writes are well ordered on Intel/AMD systems reads
  are not.  In the case of the IPIQ FIFO the data related to the arguments
  can be ordered ahead of the read of the FIFO rindex and thus wind up being
  stale relative to the other CPU writing the entry.  Moving the mfence
  ensures that the args stored in the FIFO are not accessed until after
  the rindex is read.

  For the thread aquisition code access to and manipulation of the thread
  td_allq might be based on stale out-of-order reads prior to the
  determination that the thread completed its move.

  This can be a problem because several mechanisms in DragonFly are able
  to operate without even having to use locked bus cycle.  The IPIQ, thread
  migration, and kern/sys_pipe.c being the best examples, so the natural
  barrier provided by the locked bus-cycle instruction is not necessarily
  present.

13 years agoFix UP kernel build.
Sascha Wildner [Sun, 19 Sep 2010 11:24:11 +0000 (13:24 +0200)]
Fix UP kernel build.

13 years agoinstaller: Allow for tmpfs (instead of mfs) partition creation.
Sascha Wildner [Sun, 19 Sep 2010 09:05:22 +0000 (11:05 +0200)]
installer: Allow for tmpfs (instead of mfs) partition creation.

The installer allowed (though only in UFS "expert mode") to add mfs-backed
partitions. Change all this to tmpfs as well.

13 years agoinstaller: Remove unused code to run memtest and create a memtest86 floppy.
Sascha Wildner [Sat, 18 Sep 2010 20:54:46 +0000 (22:54 +0200)]
installer: Remove unused code to run memtest and create a memtest86 floppy.

13 years agoinstaller: Remove unused code to update /usr/src with cvsup.
Sascha Wildner [Sat, 18 Sep 2010 17:05:42 +0000 (19:05 +0200)]
installer: Remove unused code to update /usr/src with cvsup.

13 years agoFix various bugs due to the mis-usage of && and ||.
Sascha Wildner [Sun, 19 Sep 2010 00:28:42 +0000 (02:28 +0200)]
Fix various bugs due to the mis-usage of && and ||.

13 years agonetwork - Fix MP races in udp6_input and inet6 in general
Matthew Dillon [Sat, 18 Sep 2010 23:29:03 +0000 (16:29 -0700)]
network - Fix MP races in udp6_input and inet6 in general

* Numerous appends to the so_rcv sockbuf needed to be protected
  by the so_rcv token.

Reported-by: Peter Avalos <pavalos@crater.dragonflybsd.org>
13 years agoSwitch our LiveCD/DVD to using tmpfs instead of mfs.
Sascha Wildner [Sat, 18 Sep 2010 22:11:13 +0000 (00:11 +0200)]
Switch our LiveCD/DVD to using tmpfs instead of mfs.

13 years agomount_tmpfs(8): Add a -C option modeled after mount_mfs(8)'s -C option.
Sascha Wildner [Sat, 18 Sep 2010 22:08:54 +0000 (00:08 +0200)]
mount_tmpfs(8): Add a -C option modeled after mount_mfs(8)'s -C option.

It will copy the contents of the underlying mount point directory into
the tmpfs mount.

13 years agonetwork - Remove debugging kprintfs
Matthew Dillon [Sat, 18 Sep 2010 21:57:02 +0000 (14:57 -0700)]
network - Remove debugging kprintfs

* Remove some console spam

13 years agokernel - Optimize kfree() to greatly reduce IPI traffic
Matthew Dillon [Sat, 18 Sep 2010 20:23:41 +0000 (13:23 -0700)]
kernel - Optimize kfree() to greatly reduce IPI traffic

* Instead of IPIing the chunk being freed to the originating cpu we
  use atomic ops to directly link the chunk onto the target slab.
  We then notify the target cpu via an IPI message only in the case where
  we believe the slab has to be entered back onto the target cpu's
  ZoneAry.

  This reduces the IPI messaging load by a factor of 100x or more.
  kfree() sends virtually no IPIs any more.

* Move malloc_type accounting to the cpu issuing the kmalloc or kfree
  (kfree used to forward the accounting to the target cpu).  The
  accounting is done using the per-cpu malloc_type accounting array
  so large deltas will likely accumulate, but they should all cancel
  out properly in the summation.

* Use the kmemusage array and kup->ku_pagecnt to track whether a
  SLAB is active or not, which allows the handler for the asynchronous IPI
  to validate that the SLAB still exists before trying to access it.

  This is necessary because once the cpu doing the kfree() successfully
  links the chunk into z_RChunks, the target slab can get ripped out
  from under it by the owning cpu.

* The special cpu-competing linked list is different from the linked list
  normally used to find free chunks, so the localized code and the
  MP code is segregated.

  We pay special attention to list ordering to try to avoid unnecessary
  cache mastership changes, though it should be noted that the c_Next
  link field in the chunk creates an issue no matter what we do.

  A 100% lockless algorithm is used.  atomic_cmpset_ptr() is used
  to manage the z_RChunks singly-linked list.

* Remove the page localization code for now.  For the life of the
  typically chunk of memory I don't think this provided much of
  an advantage.

Prodded-by: Venkatesh Srinivas
13 years agokernel: Remove #include <sys/mutex.h> if <sys/mutex2.h> is included too.
Sascha Wildner [Sat, 18 Sep 2010 18:32:38 +0000 (20:32 +0200)]
kernel: Remove #include <sys/mutex.h> if <sys/mutex2.h> is included too.

13 years agonewfs(8): Remove some leftover defines that are no longer used.
Sascha Wildner [Sat, 18 Sep 2010 18:06:33 +0000 (20:06 +0200)]
newfs(8): Remove some leftover defines that are no longer used.

13 years agoFix some synopses in various manual pages.
Sascha Wildner [Sat, 18 Sep 2010 10:05:25 +0000 (12:05 +0200)]
Fix some synopses in various manual pages.

13 years agonetwork - Correct bug in last commit
Matthew Dillon [Sat, 18 Sep 2010 00:56:27 +0000 (17:56 -0700)]
network - Correct bug in last commit

* Fix a crit_enter() that had to be removed.

Reported-by: YONETANI Tomokazu <qhwt.dfly@les.ath.cx>
13 years agonetwork - Remove crit_exit/crit_enter wrappers in pf.c
Matthew Dillon [Fri, 17 Sep 2010 23:38:37 +0000 (16:38 -0700)]
network - Remove crit_exit/crit_enter wrappers in pf.c

* Note I'm talking about exit/enter wrappers, not enter/exit wrappers.
  I believe the enter/exit wrappers can be removed too but for now
  we have to remove the exit/enter wrappers which assumed a critical
  section would be held on entry.

  This is no longer the case.  Since so much of the network stack is
  now threaded callers into PF are not necessarily holding a critical
  section to exit out of.

Reported-by: lentferj, Rumko
13 years agonetwork - Zero out m_len / m_pkthdr.len in m_get*() and friends
Matthew Dillon [Fri, 17 Sep 2010 22:29:22 +0000 (15:29 -0700)]
network - Zero out m_len / m_pkthdr.len in m_get*() and friends

* Newly allocated mbufs now set m_len and (if a packet header)
  m_pkthdr.len to 0 instead of leaving them uninitialized,
  allowing us to assert that the mbuf does not have an overrun
  later when it is freed.

Reported-by: Jan Lentfer <Jan.Lentfer@web.de>
13 years agoips - missing part from 667d31bb
YONETANI Tomokazu [Fri, 17 Sep 2010 12:03:04 +0000 (21:03 +0900)]
ips - missing part from 667d31bb

Without this change, the added strings are never used.

Noticed-by: Sascha Wildner (via DragonFly BSD Digest)
13 years agoudevd.8 - Fix SYNOPSIS
Antonio Huete Jimenez [Fri, 17 Sep 2010 10:23:37 +0000 (12:23 +0200)]
udevd.8 - Fix SYNOPSIS

13 years agoMerge branch 'master' of git://git.dragonflybsd.org/dragonfly
Matthias Schmidt [Fri, 17 Sep 2010 10:04:36 +0000 (12:04 +0200)]
Merge branch 'master' of git://git.dragonflybsd.org/dragonfly

13 years agodma - Fix the parsing of recipient addresses
Matthias Schmidt [Fri, 17 Sep 2010 09:49:53 +0000 (11:49 +0200)]
dma - Fix the parsing of recipient addresses

Author: Peter Pentchev <roam@ringlet.net>

13 years agodma - Fix double free buf
Matthias Schmidt [Fri, 17 Sep 2010 09:18:13 +0000 (11:18 +0200)]
dma - Fix double free buf

Author: Peter Pentchev <roam@ringlet.net>

13 years agodma.8 - Change wording to match dma.conf
Matthias Schmidt [Fri, 17 Sep 2010 09:16:23 +0000 (11:16 +0200)]
dma.8 - Change wording to match dma.conf

dma.conf says "Uncomment", man page says "comment".  Correct this to
match dma.conf.

Author: Peter Pentchev <roam@ringlet.net>

13 years agodma - Set correct group in Makefile.plain
Matthias Schmidt [Fri, 17 Sep 2010 09:13:31 +0000 (11:13 +0200)]
dma - Set correct group in Makefile.plain

dma needs to be setgid in group mail

Author: Peter Pentchev <roam@ringlet.net>

13 years agodma - Fix typo
Matthias Schmidt [Fri, 17 Sep 2010 08:49:03 +0000 (10:49 +0200)]
dma - Fix typo

13 years agonetwork - Fix race in accept() - try #2
Matthew Dillon [Fri, 17 Sep 2010 08:45:04 +0000 (01:45 -0700)]
network - Fix race in accept() - try #2

* The last fix wasn't good enough.  Really try to fix it this time.  Use
  a pool token and validate so_head after acquiring it to deal with races,
  interlock against 0-ref races (sockets can be on the so_comp/so_incomp
  queues with 0 references), and use it for the accept predicate.

13 years agokernel - Add lwkt_relpooltoken()
Matthew Dillon [Fri, 17 Sep 2010 08:30:10 +0000 (01:30 -0700)]
kernel - Add lwkt_relpooltoken()

* Add a convenience function that is symmetric with lwkt_getpooltoken(),
  though slightly slower than simply lwkt_reltoken()'ing the token returned
  by lwkt_getpooltoken().

13 years agonetwork - Fix race in accept()
Matthew Dillon [Fri, 17 Sep 2010 06:00:26 +0000 (23:00 -0700)]
network - Fix race in accept()

* Fix a race where a socket undergoing an accept() was not being
  referenced soon enough, resulting in a window of opportunity for
  the kernel to attempt to free it if the tcp connection resets
  before userland can finish the accept.

  This resulted in an assertion panic.

Reported-by: Peter Avalos
13 years agoutilities - Correct variable types to match kernel
Matthew Dillon [Fri, 17 Sep 2010 05:59:23 +0000 (22:59 -0700)]
utilities - Correct variable types to match kernel

* *vnodes, dirtybuf, etc are still int's in the kernel, for
  systat -vm output.

13 years agokernel: Staticize some dev_ops and adjust a name in dev/sound.
Sascha Wildner [Fri, 17 Sep 2010 03:25:59 +0000 (05:25 +0200)]
kernel: Staticize some dev_ops and adjust a name in dev/sound.

13 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 17 Sep 2010 02:56:17 +0000 (19:56 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly