]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoUse '0' rather than PZERO to not change the priority that I'm waiting
Warner Losh [Sun, 7 Dec 2008 18:34:27 +0000 (18:34 +0000)]
Use '0' rather than PZERO to not change the priority that I'm waiting
at.  I don't think this will make a huge difference, but I have
received a report of a interrupt storm on one 16-bit card that this
might fix (chances are it won't, since I think that we may need to
check both the CBB registers for the 16-bit card as well as the PCIC
registers for power state change).

Submitted by: jhb@

15 years agoUse atomic_add_int rather than a simple ++ to ensure no cache races if
Warner Losh [Sun, 7 Dec 2008 18:32:09 +0000 (18:32 +0000)]
Use atomic_add_int rather than a simple ++ to ensure no cache races if
the power interrupt and init code waiting for the interrupt are
running on different CPUs.  I haven't seen this make any real
difference, but I've also had some reports of odd behavior I can't
otherwise explain.  It is an infrequent operation, and certainly
wouldn't hurt.

15 years agoImprove usefulness of the panic by printing the pointer to the problematic
Konstantin Belousov [Sun, 7 Dec 2008 13:25:06 +0000 (13:25 +0000)]
Improve usefulness of the panic by printing the pointer to the problematic
dquot. In-tree gdb is often unable to get the dq value, so supply it in
panic message.

MFC after: 3 days

15 years agoFix spelling error (find -> found).
Nathan Whitehorn [Sun, 7 Dec 2008 06:34:50 +0000 (06:34 +0000)]
Fix spelling error (find -> found).

15 years agoNow that pmu(4) has features, it should also have a man page.
Nathan Whitehorn [Sun, 7 Dec 2008 06:18:47 +0000 (06:18 +0000)]
Now that pmu(4) has features, it should also have a man page.

15 years agoAdd filler man pages for the kinfo functions I added recently.
Peter Wemm [Sun, 7 Dec 2008 03:33:36 +0000 (03:33 +0000)]
Add filler man pages for the kinfo functions I added recently.
While here, hook up the hexdump(3) man page which wasn't being installed.

15 years agoWhen libthr and rtld start up, there are a number of magic spells cast
Peter Wemm [Sun, 7 Dec 2008 02:32:49 +0000 (02:32 +0000)]
When libthr and rtld start up, there are a number of magic spells cast
in order to get the symbol binding state "just so".  This is to allow
locking to be activated and not run into recursion problems later.

However, one of the magic bits involves an explicit call to _umtx_op()
to force symbol resolution.  It does a wakeup operation on a fake,
uninitialized (ie: random contents) umtx.  Since libthr isn't active, this
is harmless.  Nothing can match the random wakeup.

However, valgrind finds this and is not amused.  Normally I'd just
write a suppression record for it, but the idea of passing random
args to syscalls (on purpose) just doesn't feel right.

15 years agoAdd support for automated reboot after power failure on Apple Core99 machines
Nathan Whitehorn [Sun, 7 Dec 2008 00:42:15 +0000 (00:42 +0000)]
Add support for automated reboot after power failure on Apple Core99 machines
(G3 laptops, all G4 machines, early G5s, G5 Xserves). The relevant sysctl
is named dev.pmu.0.server_mode for mental compatibility with Linux.

15 years agoFix some nasty race conditions in the VIA-CUDA driver that ended up preventing
Nathan Whitehorn [Sat, 6 Dec 2008 23:26:02 +0000 (23:26 +0000)]
Fix some nasty race conditions in the VIA-CUDA driver that ended up preventing
my right mouse button and keyboard LEDs from working due to mangled
configuration packets. Fixed several other races and associated problems in the
main ADB stack that were exposed while fixing this.

15 years agoCarefully handle memory errors to keep peers compression/encryption state
Alexander Motin [Sat, 6 Dec 2008 23:00:48 +0000 (23:00 +0000)]
Carefully handle memory errors to keep peers compression/encryption state
consistent. There are some cases reported where peers fatally getting out
of sync without any visible reason. I hope this solve the problem.

15 years agoCleanup msleep() arguments.
Alexander Motin [Sat, 6 Dec 2008 21:52:32 +0000 (21:52 +0000)]
Cleanup msleep() arguments.
Move wakeup() out of the lock.

15 years agoImplement suspend/resume for mmc and mmcsd drivers.
Alexander Motin [Sat, 6 Dec 2008 21:41:27 +0000 (21:41 +0000)]
Implement suspend/resume for mmc and mmcsd drivers.
Now it is possible to suspend/resume with inserted and active card.

To reinitialize card on resume and to detect card change while suspended,
implement bus rescan routines. It can also be used by controllers without
card presence detection signals or with multiple cards per slot support.

While there, cleanup msleep() usage. We have no any rights to exit without
"request done" signal from driver as it could lead to modify after free.

15 years agoRestore memory clobber, to cause mb on the compiler level too.
Konstantin Belousov [Sat, 6 Dec 2008 21:33:44 +0000 (21:33 +0000)]
Restore memory clobber, to cause mb on the compiler level too.
Use more sane formatting of the assembler.

Pointed out by: bde

15 years agoThe startall variable should default to zero, otherwise the vap is restarted
Andrew Thompson [Sat, 6 Dec 2008 21:19:26 +0000 (21:19 +0000)]
The startall variable should default to zero, otherwise the vap is restarted
everytime an ioctl happens.

While I am here, limit the locking scope to SIOCSIFFLAGS.

15 years agoChange the default value for the flag enabling superpage mapping and
Alan Cox [Sat, 6 Dec 2008 19:37:52 +0000 (19:37 +0000)]
Change the default value for the flag enabling superpage mapping and
promotion to "on".

Reminded by: jhb
Tested by: kris

15 years agoAdd a -L option to wc(1), for finger compatibility with the GNU
Giorgos Keramidas [Sat, 6 Dec 2008 19:21:56 +0000 (19:21 +0000)]
Add a -L option to wc(1), for finger compatibility with the GNU
wc utility.  The -L option can be used to report the length of
the longest line wc has seen in one or more files.  It is
disabled by default, and wc uses the standard `-lwc'.

Submitted by: Sheldon Givens, sheldon at sigsegv.ca
Reviewed by: kib
MFC after: 1 week

15 years agoin_rtalloc1(9) returns a locked route, so make sure that we use
Christian S.J. Peron [Sat, 6 Dec 2008 19:09:38 +0000 (19:09 +0000)]
in_rtalloc1(9) returns a locked route, so make sure that we use
RTFREE_LOCKED() here.  This macro makes sure the reference count
on the route is being managed properly.  This elimates another
case which results in the following message being printed to the
console:

rtfree: 0xc841ee88 has 1 refs

Reviewed by: bz
MFC after: 2 weeks

15 years agoCorrect include path for i386 specific includes. This allows zfs
Paul Saab [Sat, 6 Dec 2008 14:45:03 +0000 (14:45 +0000)]
Correct include path for i386 specific includes.  This allows zfs
to boot on systems where the loader is built on amd64 systems.

15 years ago- Eliminate unused variable. [1]
Stanislav Sedov [Sat, 6 Dec 2008 14:23:45 +0000 (14:23 +0000)]
- Eliminate unused variable. [1]
- Check for runt frames entering the stack. [2]

Suggested by: ganbold[1], yongari[2]
Approved by: kib (mentor)
MFC after: 2 weeks

15 years agoThis is simple testing program for revision 185647.
Ganbold Tsagaankhuu [Sat, 6 Dec 2008 13:23:53 +0000 (13:23 +0000)]
This is simple testing program for revision 185647.
It invokes multiple parallel threads and each thread calls vfork()
system call.

Approved by: kib

15 years agoCode from the hack-session known as the IETF (and a
Randall Stewart [Sat, 6 Dec 2008 13:19:54 +0000 (13:19 +0000)]
Code from the hack-session known as the IETF (and a
bit of debugging afterwards):
- Fix protection code for notification generation.
- Decouple associd from vtag
- Allow vtags to have less strigent requirements in non-uniqueness.
   o don't pre-hash them when you issue one in a cookie.
   o Allow duplicates and use addresses and ports to
     discriminate amongst the duplicates during lookup.
- Add support for the NAT draft draft-ietf-behave-sctpnat-00, this
  is still experimental and needs more extensive testing with the
  Jason Butt ipfw changes.
- Support for the SENDER_DRY event to get DTLS in OpenSSL working
  with a set of patches from Michael Tuexen (hopefully heading to OpenSSL soon).
- Update the support of SCTP-AUTH by Peter Lei.
- Use macros for refcounting.
- Fix MTU for UDP encapsulation.
- Fix reporting back of unsent data.
- Update assoc send counter handling to be consistent with endpoint sent counter.
- Fix a bug in PR-SCTP.
- Fix so we only send another FWD-TSN when a SACK arrives IF and only
  if the adv-peer-ack point progressed. However we still make sure
  a timer is running if we do have an adv_peer_ack point.
- Fix PR-SCTP bug where chunks were retransmitted if they are sent
  unreliable but not abandoned yet.

With the help of: Michael Teuxen and Peter Lei :-)
MFC after:  4 weeks

15 years agoMake it possible to use gjournal for the root filesystem. Previously,
Edward Tomasz Napierala [Sat, 6 Dec 2008 11:33:10 +0000 (11:33 +0000)]
Make it possible to use gjournal for the root filesystem.  Previously,
an unclean shutdown would make it impossible to mount rootfs at boot.

PR: kern/128529
Reviewed by: pjd
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation

15 years ago- correct variable name
Daniel Gerzo [Sat, 6 Dec 2008 11:21:10 +0000 (11:21 +0000)]
- correct variable name

PR: docs/129448
Submitted by: Kenyon Ralph <kralph@gmail.com>
MFC after: Revision 1.91 is merged

15 years agoImport the strndup(3) function.
Konstantin Belousov [Sat, 6 Dec 2008 09:37:54 +0000 (09:37 +0000)]
Import the strndup(3) function.
Copyright attribution is kept the same as in original NetBSD source.

Submitted by: Florian Smeets <flo kasimir com>
Obtained from: NetBSD
MFC after: 2 weeks

15 years agoOrder the str*.c files mostly alphabetical.
Konstantin Belousov [Sat, 6 Dec 2008 09:28:46 +0000 (09:28 +0000)]
Order the str*.c files mostly alphabetical.

Submitted by: Florian Smeets <flo kasimir com>
MFC after: 2 weeks

15 years agobsdtar is synced up with 2.5.903a
Tim Kientzle [Sat, 6 Dec 2008 07:38:14 +0000 (07:38 +0000)]
bsdtar is synced up with 2.5.903a

15 years agobsdtar always supports long options now, so we can remove
Tim Kientzle [Sat, 6 Dec 2008 07:37:55 +0000 (07:37 +0000)]
bsdtar always supports long options now, so we can remove
a documentation disclaimer.

15 years agoOnly use GCC-specific __dead2 marker when building with GCC.
Tim Kientzle [Sat, 6 Dec 2008 07:37:14 +0000 (07:37 +0000)]
Only use GCC-specific __dead2 marker when building with GCC.

15 years agoCustom command line parser for cpio; this is a little more
Tim Kientzle [Sat, 6 Dec 2008 07:30:40 +0000 (07:30 +0000)]
Custom command line parser for cpio; this is a little more
code but should be a lot fewer cross-platform compatibility
headaches.

15 years agoMake the GCC-specific __dead2 markers conditional on whether
Tim Kientzle [Sat, 6 Dec 2008 07:15:42 +0000 (07:15 +0000)]
Make the GCC-specific __dead2 markers conditional on whether
we're compiling under GCC.

15 years agoNew tests:
Tim Kientzle [Sat, 6 Dec 2008 07:08:08 +0000 (07:08 +0000)]
New tests:
 * support for bzip2 file with multiple concatenated bzip2 streams
 * support for bzip2 file with junk after bzip2 stream
 * support for gzip file with junk after gzip stream
 * "fuzz" tester randomly modifies a bunch of input files in order to try
   to crash libarchive (this found an amusing hang in the ISO9660 code
   when trying to read images that advertised a zero blocksize).

This test is implemented, but commented out for now:
 * support for gzip file with multiple concatenated gzip streams

15 years agoStrip ";1" and trailing "." from ISO9660 entries.
Tim Kientzle [Sat, 6 Dec 2008 06:57:45 +0000 (06:57 +0000)]
Strip ";1" and trailing "." from ISO9660 entries.
This seems a better match for people's expectations.

15 years agoGeneral improvements to Rockridge parsing and ISO9660 format detection.
Tim Kientzle [Sat, 6 Dec 2008 06:55:07 +0000 (06:55 +0000)]
General improvements to Rockridge parsing and ISO9660 format detection.

15 years agoConditionalize a bunch of debugging messages; this also
Tim Kientzle [Sat, 6 Dec 2008 06:50:09 +0000 (06:50 +0000)]
Conditionalize a bunch of debugging messages; this also
eliminates what should be the only remaining stdio dependency.

15 years agoMfP4: Big read filter refactoring.
Tim Kientzle [Sat, 6 Dec 2008 06:45:15 +0000 (06:45 +0000)]
MfP4: Big read filter refactoring.

This is an attempt to eliminate a lot of redundant
code from the read ("decompression") filters by
changing them to juggle arbitrary-sized blocks
and consolidate reblocking code at a single point
in archive_read.c.

Along the way, I've changed the internal read/consume
API used by the format handlers to a slightly
different style originally suggested by des@.  It
does seem to simplify a lot of common cases.

The most dramatic change is, of course, to
archive_read_support_compression_none(), which
has just evaporated into a no-op as the blocking
code this used to hold has all been moved up
a level.

There's at least one more big round of refactoring
yet to come before the individual filters are as
straightforward as I think they should be...

15 years agoStyle: tabs after #define
Tim Kientzle [Sat, 6 Dec 2008 06:23:37 +0000 (06:23 +0000)]
Style: tabs after #define

15 years agoUse GCC-specific dead function markers only when using GCC.
Tim Kientzle [Sat, 6 Dec 2008 06:20:21 +0000 (06:20 +0000)]
Use GCC-specific dead function markers only when using GCC.

15 years agoStructure declarations can't be dllexported.
Tim Kientzle [Sat, 6 Dec 2008 06:18:46 +0000 (06:18 +0000)]
Structure declarations can't be dllexported.

15 years agoStyle fixes:
Tim Kientzle [Sat, 6 Dec 2008 06:17:18 +0000 (06:17 +0000)]
Style fixes:
 * Wrap long declarations to fit 80 chars
 * #undef macros that shouldn't be exported
 * Organize the version-dependent conditionals a
   bit more consistently

Speculative:
 * libarchive 3.0 will (eventually) use int64_t
   instead of off_t.  This is an attempt to avoid
   some the headaches caused by Linux LFS.  (I'll
   still have to do ugly things for the struct stat
   references in archive_entry.h, of course.)

15 years agoA couple of portability fixes from Joerg Sonnenberger
Tim Kientzle [Sat, 6 Dec 2008 06:12:24 +0000 (06:12 +0000)]
A couple of portability fixes from Joerg Sonnenberger

15 years agoRecover after test failure.
Tim Kientzle [Sat, 6 Dec 2008 06:02:26 +0000 (06:02 +0000)]
Recover after test failure.

15 years agoStyle: skipping() function correctly counts this as a skipped test.
Tim Kientzle [Sat, 6 Dec 2008 06:01:50 +0000 (06:01 +0000)]
Style:  skipping() function correctly counts this as a skipped test.

15 years agoStyle improvements.
Tim Kientzle [Sat, 6 Dec 2008 06:00:52 +0000 (06:00 +0000)]
Style improvements.

15 years agoBetter reporting of test failures.
Tim Kientzle [Sat, 6 Dec 2008 05:59:46 +0000 (05:59 +0000)]
Better reporting of test failures.

15 years agoRecover from a test failure here.
Tim Kientzle [Sat, 6 Dec 2008 05:58:24 +0000 (05:58 +0000)]
Recover from a test failure here.

15 years agoNew internal archive_string_concat utility function.
Tim Kientzle [Sat, 6 Dec 2008 05:56:43 +0000 (05:56 +0000)]
New internal archive_string_concat utility function.

15 years agoMinor portability: Declare 'r' only within the conditional
Tim Kientzle [Sat, 6 Dec 2008 05:55:46 +0000 (05:55 +0000)]
Minor portability:  Declare 'r' only within the conditional
block where it's used; S_ISLNK is more portable than S_ISLINK.

15 years agoWindows build now uses PLATFORM_CONFIG_H macro, so we can eliminate the
Tim Kientzle [Sat, 6 Dec 2008 05:53:05 +0000 (05:53 +0000)]
Windows build now uses PLATFORM_CONFIG_H macro, so we can eliminate the
special case for it.

15 years ago2 is more portable than STDERR_FILENO
Tim Kientzle [Sat, 6 Dec 2008 05:52:01 +0000 (05:52 +0000)]
2 is more portable than STDERR_FILENO

15 years agoBug fix to support N310 version of Chelsio cards (board ID 1088).
George V. Neville-Neil [Sat, 6 Dec 2008 02:10:53 +0000 (02:10 +0000)]
Bug fix to support N310 version of Chelsio cards (board ID 1088).

Obtained from: Chelsio Inc.
MFC after: 3 days

15 years agoForget current bus power settings on full reset. Chip must be reconfigured.
Alexander Motin [Sat, 6 Dec 2008 01:31:07 +0000 (01:31 +0000)]
Forget current bus power settings on full reset. Chip must be reconfigured.

Do not issue command if there is no card, clock or power.
Controller will not detect command timeout without clock active.

15 years agoCorrect a typo.
Jens Schweikhardt [Fri, 5 Dec 2008 22:04:52 +0000 (22:04 +0000)]
Correct a typo.

15 years agoRe submit code to print the part and serial number for Chelsio cards.
George V. Neville-Neil [Fri, 5 Dec 2008 21:40:11 +0000 (21:40 +0000)]
Re submit code to print the part and serial number for Chelsio cards.
The original code was accidentally removed in another commit.

MFC after: 1 day

15 years agoAdd simple locking for the in-kernel iconv code. Translation operations
John Baldwin [Fri, 5 Dec 2008 21:19:24 +0000 (21:19 +0000)]
Add simple locking for the in-kernel iconv code.  Translation operations
do not need any locking.  Opening and closing translators is serialized
using an sx lock.

Note: This depends on the earlier fix to kern_module.c to properly order
MOD_UNLOAD events.

MFC after: 2 months

15 years agoUnconditionally use locked addition of zero to tip of the stack for
Konstantin Belousov [Fri, 5 Dec 2008 21:17:54 +0000 (21:17 +0000)]
Unconditionally use locked addition of zero to tip of the stack for
memory barriers on i386. It works as a serialization instruction on
all IA32 CPUs.

Alternative solution of using {s,l,}fence requires run-time checking
of the presense of the corresponding SSE or SSE2 extensions, and
possible boot-time patching of the kernel text.

Suggested by: many

15 years agoSeveral threads in a process may do vfork() simultaneously. Then, all
Konstantin Belousov [Fri, 5 Dec 2008 20:50:24 +0000 (20:50 +0000)]
Several threads in a process may do vfork() simultaneously. Then, all
parent threads sleep on the parent' struct proc until corresponding
child releases the vmspace. Each sleep is interlocked with proc mutex of
the child, that triggers assertion in the sleepq_add(). The assertion
requires that at any time, all simultaneous sleepers for the channel use
the same interlock.

Silent the assertion by using conditional variable allocated in the
child. Broadcast the variable event on exec() and exit().

Since struct proc * sleep wait channel is overloaded for several
unrelated events, I was unable to remove wakeups from the places where
cv_broadcast() is added, except exec().

Reported and tested by: ganbold
Suggested and reviewed by: jhb
MFC after: 2 week

15 years agoSome libstand/bootp.c extension (written by Danny Braniss, slightly
Luigi Rizzo [Fri, 5 Dec 2008 17:13:40 +0000 (17:13 +0000)]
Some libstand/bootp.c extension (written by Danny Braniss, slightly
revised/modified by me) to store dhcp options into kenv variables,
so the information is available to the boot loader and can be used
to customize the boot process.

The change is totally unintrusive, essentially made of a single
function to be called while parsing a dhcp response, and a couple
of tables to classify options.  The values extracted from dhcp
options are stored in the kenv environment in one of these forms:

 + options whose name and type is known are saved as
        dhcp.name = value     (string, or number/ip addresses lists)

 + unknown options are assumed to be strings and saved as
        dhcp.option-NNN = "value"

 + options listed as '__INDIR' and sent on the wire as e.g.
        option unknown-252 "some.name=the actual value"
   are saved as
        some.name = "the actual value"

 + options listed as '__ILIST' and sent on the wire as e.g.
        option unknown-249 "a.b=foo bar; c.d= 123; e.f=done"
   are saved as multiple values
        a.b="foo bar"
        c.d="123"
        e.f="done"

As you can see there is quite a bit of flexibility on what can
be passed to the loader or the kernel.

For the time being the vendor-specific table is mostly disabled,
because there is no standard set of options for FreeBSD, and I don't
know all the pxe-specific vendor options.

Also, applications using libstand may live in memory-constrained
environments, so it makes sense to keep these tables as small as
possible, especially considering that one can generate arbitrary
name=value pairs using site-specific options of type __INDIR or
__ILIST (there are 4 __ILIST and 5 __INDIR in the table, numbered
246..249 and 250..254).

Actually, considering that probably 75% of the standard dhcp options
are totally useless, it might make sense to remove them as well.

Submitted by: Danny Braniss
MFC after: 4 weeks

15 years agoWhen the SYSINIT() to load a module invokes the MOD_LOAD event successfully,
John Baldwin [Fri, 5 Dec 2008 16:47:30 +0000 (16:47 +0000)]
When the SYSINIT() to load a module invokes the MOD_LOAD event successfully,
move that module to the head of the associated linker file's list of modules.
The end result is that once all the modules are loaded, they are sorted in
the reverse of their load order.  This causes the kernel linker to invoke
the MOD_QUIESCE and MOD_UNLOAD events in the reverse of the order that
MOD_LOAD was invoked.  This means that the ordering of MOD_LOAD events that
is set by the SI_* paramters to DECLARE_MODULE() are now honored in the same
order they would be for SYSUNINIT() for the MOD_QUIESCE and MOD_UNLOAD
events.

MFC after: 1 month

15 years agoAdd an easier example.
Pawel Jakub Dawidek [Fri, 5 Dec 2008 15:50:59 +0000 (15:50 +0000)]
Add an easier example.

Reviewed by: trasz

15 years agoAvoid confusion and adjust link address range of Marvell Orion kernel so it is
Rafal Jaworowski [Fri, 5 Dec 2008 15:31:51 +0000 (15:31 +0000)]
Avoid confusion and adjust link address range of Marvell Orion kernel so it is
the same as for Kirkwood and Discovery.

15 years agoFix configuration of the PCI bridge. This got omitted in the initial import of
Rafal Jaworowski [Fri, 5 Dec 2008 15:27:28 +0000 (15:27 +0000)]
Fix configuration of the PCI bridge. This got omitted in the initial import of
this code.

15 years agoIn a case of CARP status change run through the if_link_state_change()
Gleb Smirnoff [Fri, 5 Dec 2008 14:37:14 +0000 (14:37 +0000)]
In a case of CARP status change run through the if_link_state_change()
routine, so that devd(8) and others are notified about link state change.

15 years ago- Invoke MOD_QUIESCE on all modules in a linker file (kld) before
John Baldwin [Fri, 5 Dec 2008 13:40:25 +0000 (13:40 +0000)]
- Invoke MOD_QUIESCE on all modules in a linker file (kld) before
  unloading any modules.  As a result, if any module veto's an unload
  request via MOD_QUIESCE, the entire set of modules for that linker
  file will remain loaded and active now rather than leaving the kld
  in a weird state where some modules are loaded and some are unloaded.
- This also moves the logic for handling the "forced" unload flag out of
  kern_module.c and into kern_linker.c which is a bit cleaner.
- Add a module_name() routine that returns the name of a module and use that
  instead of printing pointer values in debug messages when a module fails
  MOD_QUIESCE or MOD_UNLOAD.

MFC after: 1 month

15 years agoImprove db_backtrace() for compat ia32 on amd64. 32bit image enters
Konstantin Belousov [Fri, 5 Dec 2008 11:34:36 +0000 (11:34 +0000)]
Improve db_backtrace() for compat ia32 on amd64. 32bit image enters
the kernel via Xint0x80_syscall().

Submitted by: dchagin
MFC after: 1 week

15 years agoMove to using filter for the change interrupts. Also rework the power
Warner Losh [Fri, 5 Dec 2008 05:20:08 +0000 (05:20 +0000)]
Move to using filter for the change interrupts.  Also rework the power
interrupt code to be more robust.  I've been running these changes for
over a year...  With these changes, I don't see the ath card going
into reset like the code in the tree.

15 years agoMinor style nit.
Warner Losh [Fri, 5 Dec 2008 04:48:04 +0000 (04:48 +0000)]
Minor style nit.

15 years agoAugment comments, and move things around a smidge.
Warner Losh [Fri, 5 Dec 2008 04:46:26 +0000 (04:46 +0000)]
Augment comments, and move things around a smidge.

15 years agoImplement a method described in NetBSD PR 36652 for coping with the
Warner Losh [Fri, 5 Dec 2008 04:43:25 +0000 (04:43 +0000)]
Implement a method described in NetBSD PR 36652 for coping with the
BAD VCC bit.

15 years agoFix a bug with the ael1006 PHY. The bug shows up as persistent but incomplete
George V. Neville-Neil [Thu, 4 Dec 2008 20:32:53 +0000 (20:32 +0000)]
Fix a bug with the ael1006 PHY.  The bug shows up as persistent but incomplete
packet loss, of between 10-30%. The fix is to put the PHY into
and take it out of local loopback mode when resetting the interface.

Obtained from: Chelsio Inc.
MFC after: 3 days

15 years agoPut the MIPS support back in after it was removed in r185029.
Warner Losh [Thu, 4 Dec 2008 16:31:08 +0000 (16:31 +0000)]
Put the MIPS support back in after it was removed in r185029.

15 years ago Integrate 185578 from dfr
Kip Macy [Thu, 4 Dec 2008 07:59:05 +0000 (07:59 +0000)]
 Integrate 185578 from dfr
 Use newbus to managed devices

15 years ago fix initialization for case of normal kernbase
Kip Macy [Thu, 4 Dec 2008 07:28:13 +0000 (07:28 +0000)]
 fix initialization for case of normal kernbase
 remove unused shutdown code

15 years agoAdd HW MAC counter support for newer JMC250/JMC260 revisions.
Pyun YongHyeon [Thu, 4 Dec 2008 02:16:53 +0000 (02:16 +0000)]
Add HW MAC counter support for newer JMC250/JMC260 revisions.

15 years agoAdd support for newer JMC250/JMC260 revisions.
Pyun YongHyeon [Thu, 4 Dec 2008 01:58:40 +0000 (01:58 +0000)]
Add support for newer JMC250/JMC260 revisions.
 o Chip full mask revision 2 or later controllers have to
   set correct Tx MAC and Tx offload clock depending on negotiated
   link speed.
 o JMC260 chip full mask revision 2 has a silicon bug that can't
   handle 64bit DMA addressing. Add workaround to the bug by
   limiting DMA address space to be within 32bit.
 o Valid FIFO space of receive control and status register was
   changed on chip full mask revision 2 or later controllers. For
   these controllers, use default 16QW as it's supposed to be the
   safest value for maximum PCIe compatibility. JMicron confirmed
   performance will not be reduced even if the FIFO space is set
   to 16QW.
 o When interface is put into suspend/shutdown state, remove Tx MAC
   and Tx offload clock to save more power. We don't need Tx clock
   at all in this state.
 o Added new register definition for chip full mask revision 2 or
   later controllers.

Thanks to JMicron for their continuous support of FreeBSD.

15 years agoFix build - cast off_t to (intmax_t) for printing.
Max Laier [Wed, 3 Dec 2008 23:00:57 +0000 (23:00 +0000)]
Fix build - cast off_t to (intmax_t) for printing.

15 years agoDon't attempt to clear status updates if we did not do a link state
Xin LI [Wed, 3 Dec 2008 23:00:00 +0000 (23:00 +0000)]
Don't attempt to clear status updates if we did not do a link state
change.  As a side effect, this makes the excessive interrupts to
disappear which has been observed as a regression in recent stable/7.

Reported by: many (on -stable@)
Reviewed by: davidch

15 years agoWhen unloading a 32-bit system call module, restore the sysent vector in
John Baldwin [Wed, 3 Dec 2008 18:45:38 +0000 (18:45 +0000)]
When unloading a 32-bit system call module, restore the sysent vector in
the 32-bit system call table instead of the main system call table.

15 years agoEnable operation of newfs on plain files, which is useful when you
Luigi Rizzo [Wed, 3 Dec 2008 18:36:59 +0000 (18:36 +0000)]
Enable operation of newfs on plain files, which is useful when you
want to prepare disk images for emulators (though 'makefs' in port
can do something similar).

This relies on:
+ minor changes to pass the consistency checks even when working on a file;

+ an additional option, '-p partition' , to specify the disk partition to
  initialize;

+ some changes on the I/O routines to deal with partition offsets.

The latter was a bit tricky to implement, see the details in newfs.h:
in newfs, I/O is done through libufs which assumes that the file
descriptor refers to the whole partition. Introducing support for
the offset in libufs would require a non-backward compatible change
in the library, to be dealt with a version bump or with symbol
versioning.

I felt both approaches to be overkill for this specific application,
especially because there might be other changes to libufs that might
become necessary in the near future.

So I used the following trick:
- read access is always done by calling bread() directly, so we just add
  the offset in the (few) places that call bread();
- write access is done through bwrite() and sbwrite(), which in turn
  calls bwrite(). To avoid rewriting sbwrite(), we supply our own version
  of bwrite() here, which takes precedence over the version in libufs.

MFC after: 4 weeks

15 years agoSome useful operational extensions to newfs_msdos, especially
Luigi Rizzo [Wed, 3 Dec 2008 18:22:36 +0000 (18:22 +0000)]
Some useful operational extensions to newfs_msdos, especially
when preparing images for emulators or flash devices:

+ option '-C size' to create the underlying image file with given size.
  Saves doing a 'dd' before, and especially it creates a sparse file

+ option '-@ offset' to build the FAT image at the specified offset
  in the image file or device;

+ make the cluster size adaptive on the filesystem size.
  Previously the default was 4k which is really unconvenient with
  large media; now it goes from 512 bytes to 32k depending on
  filesystem size (i still need to check whether it makes sense
  to go further up, to 64k or above);

+ fix default geometry when not specified on the command line,
  use 63 sectors/255 heads by default.
  Also trim the size so it exactly a multiple of a track, to avoid
  complaints in some filesystem code.

+ document all the above, plus some manual page clarifications.

MFC after: 4 weeks

15 years agoChange nfsserver slightly so that it does not trip over the timestamp
Alexander Kabaev [Wed, 3 Dec 2008 17:54:09 +0000 (17:54 +0000)]
Change nfsserver slightly so that it does not trip over the timestamp
validation code on ZFS.

Problem: when opening file with O_CREAT|O_EXCL NFS has to jump through
extra hoops to ensure O_EXCL semantics. Namely, client supplies of 8
bytes (NFSX_V3CREATEVERF) bytes of verification data to uniquely
identify this create request. Server then creates a new file with access
mode 0, copies received 8 bytes into va_atime member of struct vattr and
attempt to set the atime on file using VOP_SETATTR. If that succeeds, it
fetches file attributes with VOP_GETATTR and verifies that atime
timestamps match.  If timestamps do not match, NFS server concludes it
has probbaly lost the race to another process creating the file with the
same name and bails with EEXIST.

This scheme works OK when exported FS is FFS, but if underlying
filesystem is ZFS _and_ server is running 64bit kernel, it breaks down
due to sanity checking in zfs_setattr function, which refuses to accept
any timestamps which have tv_sec that cannot be represented as 32bit
int. Since struct timespec fields are 64 bit integers on 64bit platforms
and server just copies NFSX_V3CREATEVERF bytes info va_atime, all eight
bytes supplied by client end up in va_atime.tv_sec, forcing it out of
valid 32bit range.

The solution this change implements is simple: it treats
NFSX_V3CREATEVERF as two 32bit integers and unpacks them separately into
va_atime.tv_sec and va_atime.tv_nsec respectively, thus guaranteeing
that tv_sec remains in 32 bit range and ZFS remains happy.

Reviewed by: kib

15 years agoFixes for Core2 Extreme support.
Joseph Koshy [Wed, 3 Dec 2008 17:30:36 +0000 (17:30 +0000)]
Fixes for Core2 Extreme support.

Submitted by:  "Artem Belevich" <artemb at gmail dot com>

15 years agoChange new card identification names.
Doug Ambrisko [Wed, 3 Dec 2008 16:29:12 +0000 (16:29 +0000)]
Change new card identification names.

Submitted by: LSI
MFC after: 3 days

15 years agoFix a credential reference leak. [1]
Bjoern A. Zeeb [Wed, 3 Dec 2008 15:54:35 +0000 (15:54 +0000)]
Fix a credential reference leak. [1]

Close subtle but relatively unlikely race conditions when
propagating the vnode write error to other active sessions
tracing to the same vnode, without holding a reference on
the vnode anymore. [2]

PR: kern/126368 [1]
Submitted by: rwatson [2]
Reviewed by: kib, rwatson
MFC after: 4 weeks

15 years agoAdd aliases that map architectural event names to fixed function counters.
Joseph Koshy [Wed, 3 Dec 2008 15:23:08 +0000 (15:23 +0000)]
Add aliases that map architectural event names to fixed function counters.

15 years agoAnother, hopefully final set of changes to boot0 and boot0cfg.
Luigi Rizzo [Wed, 3 Dec 2008 14:53:59 +0000 (14:53 +0000)]
Another, hopefully final set of changes to boot0 and boot0cfg.

boot0.S changes:

+ import a patch from Christoph Mallon to rearrange the various
  print functions and save another couple of bytes;

+ implement the suggestion in PR 70531 to enable booting from
  any valid partition because even the extended partitions that
  were previously in our kill list may contain a valid boot loader.
  This simplifies the code and saves some bytes;

+ followwing up PR 127764, implement conditional code to preserve
  the 'Volume ID' which might be used by other OS (NT, XP, Vista)
  and is located at offset 0x1b8. This requires a relocation of the
  parameter block within the boot sector -- there is no other
  possible workaround.
  To address this, boot0cfg has been updated to handle both
  versions of the boot code;

+ slightly rearrange the strings printed in the menus to make
  the code buildable with all options. Given the tight memory
  budget, this means that with certain options we need to
  shrink or remove certain labels.

and especially:

make -DVOLUME_LABEL -DPXE the default options.

  This means that the newly built boot0 block will preserve the
  Volume ID, and has the (hidden) option F6 to boot from INT18/PXE.
  I think the extra functionality is well worth the change.

  The most visible difference here is that the 'Default: ' string
  now becomes 'Boot: ' (it can be reverted to the old value
  but then we need to nuke 1/2 partition name or entries to
  make up for the extra room).

boot0cfg changes:

+ modify the code to recognise the new boot0 structure (with the
  relocated options block to make room for the Volume id).

+ add two options, '-i xxxx-xxxx' to set the volume ID, -e c
  to modify the character printed in case of bad input

PR: 127764 70531
Submitted by: Christoph Mallon (portions)
MFC after: 4 weeks

15 years agoAR8113 also need to set DMA read burst value. This should fix
Pyun YongHyeon [Wed, 3 Dec 2008 09:01:12 +0000 (09:01 +0000)]
AR8113 also need to set DMA read burst value. This should fix
occasional DMA read error seen on AR8113.

Submitted by: Jie Yang < Jie.Yang <> Atheros com >

15 years agoAdd some PHY magic to enable PHY hibernation and 1000baseT/10baseT
Pyun YongHyeon [Wed, 3 Dec 2008 08:56:01 +0000 (08:56 +0000)]
Add some PHY magic to enable PHY hibernation and 1000baseT/10baseT
power adjustment. This change is required to guarantee correct
operation on certain switches.

Submitted by: Jie Yang < Jie.Yang <> Atheros com >

15 years agoUpdate if_iqdrops instead of if_ierrors when m_devget(9) fails.
Pyun YongHyeon [Wed, 3 Dec 2008 03:20:18 +0000 (03:20 +0000)]
Update if_iqdrops instead of if_ierrors when m_devget(9) fails.

15 years agoUpdate bce(4)'s hardware list to reflect the recent update to driver.
Xin LI [Wed, 3 Dec 2008 01:48:19 +0000 (01:48 +0000)]
Update bce(4)'s hardware list to reflect the recent update to driver.

MFC after: 3 days

15 years agoMerge OpenBSM 1.1 alpha 2 from the OpenBSM vendor branch to head, both
Robert Watson [Tue, 2 Dec 2008 23:26:43 +0000 (23:26 +0000)]
Merge OpenBSM 1.1 alpha 2 from the OpenBSM vendor branch to head, both
contrib/openbsm (svn merge) and sys/{bsm,security/audit} (manual merge).

- Add OpenBSM contrib tree to include paths for audit(8) and auditd(8).
- Merge support for new tokens, fixes to existing token generation to
  audit_bsm_token.c.
- Synchronize bsm includes and definitions.

OpenBSM history for imported revisions below for reference.

MFC after:      1 month
Sponsored by:   Apple Inc.
Obtained from:  TrustedBSD Project

--

OpenBSM 1.1 alpha 2

- Include files in OpenBSM are now broken out into two parts: library builds
  required solely for user space, and system includes, which may also be
  required for use in the kernels of systems integrating OpenBSM.  Submitted
  by Stacey Son.
- Configure option --with-native-includes allows forcing the use of native
  include for system includes, rather than the versions bundled with OpenBSM.
  This is intended specifically for platforms that ship OpenBSM, have adapted
  versions of the system includes in a kernel source tree, and will use the
  OpenBSM build infrastructure with an unmodified OpenBSM distribution,
  allowing the customized system includes to be used with the OpenBSM build.
  Submitted by Stacey Son.
- Various strcpy()'s/strcat()'s have been changed to strlcpy()'s/strlcat()'s
  or asprintf().  Added compat/strlcpy.h for Linux.
- Remove compatibility defines for old Darwin token constant names; now only
  BSM token names are provided and used.
- Add support for extended header tokens, which contain space for information
  on the host generating the record.
- Add support for setting extended host information in the kernel, which is
  used for setting host information in extended header tokens.  The
  audit_control file now supports a "host" parameter which can be used by
  auditd to set the information; if not present, the kernel parameters won't
  be set and auditd uses unextended headers for records that it generates.

OpenBSM 1.1 alpha 1

- Add option to auditreduce(1) which allows users to invert sense of
  matching, such that BSM records that do not match, are selected.
- Fix bug in audit_write() where we commit an incomplete record in the
  event there is an error writing the subject token.  This was submitted
  by Diego Giagio.
- Build support for Mac OS X 10.5.1 submitted by Eric Hall.
- Fix a bug which resulted in host XML attributes not being arguments so
  that const strings can be passed as arguments to tokens.  This patch was
  submitted by Xin LI.
- Modify the -m option so users can select more then one audit event.
- For Mac OS X, added Mach IPC support for audit trigger messages.
- Fixed a bug in getacna() which resulted in a locking problem on Mac OS X.
- Added LOG_PERROR flag to openlog when -d option is used with auditd.
- AUE events added for Mac OS X Leopard system calls.

15 years agoImprove grammar.
Christian Brueffer [Tue, 2 Dec 2008 22:45:01 +0000 (22:45 +0000)]
Improve grammar.

Submitted by: Ben Kaduk

15 years agoRather than using hidden includes (with cicular dependencies),
Bjoern A. Zeeb [Tue, 2 Dec 2008 21:37:28 +0000 (21:37 +0000)]
Rather than using hidden includes (with cicular dependencies),
directly include only the header files needed. This reduces the
unneeded spamming of various headers into lots of files.

For now, this leaves us with very few modules including vnet.h
and thus needing to depend on opt_route.h.

Reviewed by: brooks, gnn, des, zec, imp
Sponsored by: The FreeBSD Foundation

15 years agoMake the "test" target test the compiled version, instead of the
Poul-Henning Kamp [Tue, 2 Dec 2008 19:49:41 +0000 (19:49 +0000)]
Make the "test" target test the compiled version, instead of the
installed version of the md library.

15 years agoRemove "[KEEP THIS!]" from COMPAT_43TTY. It's not really that important.
Ed Schouten [Tue, 2 Dec 2008 19:09:08 +0000 (19:09 +0000)]
Remove "[KEEP THIS!]" from COMPAT_43TTY. It's not really that important.

Sgtty is a programming interface that has been replaced by termios over
the years. In June we already removed <sgtty.h>, which exposes the
ioctl()'s that are implemented by this interface. The importance of this
flag is overrated right now.

15 years agoRemove slip.log. Slip got removed as part of the MPSAFE tty work. If
Ken Smith [Tue, 2 Dec 2008 18:13:29 +0000 (18:13 +0000)]
Remove slip.log.  Slip got removed as part of the MPSAFE tty work.  If
it does come back it would probably be better if users who were interested
in slip added appropriate lines instead of this being here unconditionally.

Reminded by: tut <at> nhamon <dot> com <dot> ua

15 years agoThe slip.log file got removed along with the MPSAFE tty work. If slip
Ken Smith [Tue, 2 Dec 2008 16:46:01 +0000 (16:46 +0000)]
The slip.log file got removed along with the MPSAFE tty work.  If slip
does ever come back it's probably best if its log file be something that
gets added if the user decided they want to run slip instead of having
it here unconditionally.

15 years agoBug fix from Chelsio which addresses the issue of the device resetting
George V. Neville-Neil [Tue, 2 Dec 2008 15:42:47 +0000 (15:42 +0000)]
Bug fix from Chelsio which addresses the issue of the device resetting
when it sees only received packets.  In some cases where a device only
recieves data it mistakenly thinks that its transmitting side is broken
and resets the device.

Obtained from: Chelsio Inc.
MFC after: 3 days

15 years agoUpdate format string for kve_start/end.
Peter Wemm [Tue, 2 Dec 2008 15:08:33 +0000 (15:08 +0000)]
Update format string for kve_start/end.

15 years agoThis commits brings in a lot of documentation and some enhancement
Luigi Rizzo [Tue, 2 Dec 2008 14:57:48 +0000 (14:57 +0000)]
This commits brings in a lot of documentation and some enhancement
of the boot0.S code, with a number of compile-time selectable options,
the most interesting one being the ability to select PXE booting.

The code is completely compatible with the previous one, and with
the boot0cfg program. Even the actual code is largely unmodified,
with only minor rearrangements or fixes to make room for the new
features.

The behaviour of the standard build differs from the previous
version in the following, minor things:

+ 'noupdate' is the default, which means the code does not
  write back the selection to disk. You can enable the feature
  at runtime with boot0cfg, or changing the flags in the Makefile.

+ a drive number of 0x00 (floppy, or USB in floppy emulation) is
  now accepted as valid. Previously, it was overridden with 0x80,
  meaning that the partition table coming from the media was
  used to access sectors on a possibly different media.
  You can revert to the previous mode building with -DCHECK_DRIVE,
  and you can always use the 'setdrv' option in boot0cfg

+ certain FAT or NTFS partitions are listed as WIN instead of DOS.

+ the 'bel' character on a bad selection is replaced by a '#' to
  make it clear that the system is not hang even if the machine
  does not have a speaker. This can be reverted back at compile
  time, or at runtime with an upcoming boot0cfg option.

Additional features are available as compile time options,
and may be become the default if deemed useful. In particular:

+ INT18/PXE boot (make -DPXE)
  This option enables booting through INT 18h (which on certain
  BIOSes can be hooked to PXE) by pressing F6. There is unfortunately
  no room to print the additional menu option.
  Also, to make room for the code, the 'Default: ' string is
  changed to 'Boot: '

+ print current drive number (make -DTEST)
  Prints a line indicating the current drive number.
  This is useful to figure out what is going on for machines/bioses
  which remap drives in sometimes surprising ways.

+ disable numeric keys in console mode (make -DONLY_F_KEYS)
  Not really a significant option, but it is needed to make
  room for the -DTEST mode.

+ disable floppy support (make -DCHECK_DRIVE)
  Revert to the old behaviour of only accepting 0x80 and above
  as valid drive numbers.

MFC after: 6 weeks

15 years agoRemove unused variable.
Ganbold Tsagaankhuu [Tue, 2 Dec 2008 14:19:53 +0000 (14:19 +0000)]
Remove unused variable.

Found with:     Coverity Prevent(tm)
CID: 3685

Approved by: jhb