Commit Graph

180106 Commits

Author SHA1 Message Date
emax
682335a36d Plug more refcount leaks and possible NULL deref for interface
address list.

Submitted by:	scottl@
MFC after:	3 days
2012-06-04 18:43:51 +00:00
delphij
8c1e854769 Replace the use of wall clock time with monotonically increasing
clock.  In general, gettimeofday() is not appropriate interface
when accounting for elasped time because it can go backward, in
which case the policy code could errornously consider the limit
as exceeded.

MFC after:	1 week
Reported by:	Mahesh Arumugam
Submitted by:	Dorr H. Clark via gnn
Sponsored by:	Citrix / NetScaler
2012-06-04 18:02:09 +00:00
dim
975500b689 Make aicasm compile without warnings if -Wpointer-sign is enabled.
MFC after:	3 days
2012-06-04 17:22:43 +00:00
gnn
8b6349798e Integrate a fix for a very odd signal delivery problem found
by Bryan Cantril and others in the Solaris/Illumos version of DTrace.

Obtained from: https://www.illumos.org/issues/789
MFC after:	2 weeks
2012-06-04 16:15:40 +00:00
zml
af0c1bd2f5 Fix DTrace TSC skew calculation:
The skew calculation here is exactly backwards. We were able to repro
it on a multi-package ESX server running a FreeBSD VM, where the TSCs
can be pretty evil.

MFC after: 1 week

Submitted by: Jeff Ford <jeffrey.ford2@isilon.com>
Reviewed by: avg, gnn
2012-06-04 16:04:01 +00:00
mjg
d351cdcdf9 Add myself as a new committer.
Approved by:	trasz (mentor)
2012-06-04 15:21:13 +00:00
glebius
b0d113b96e Microoptimisation of code from r236560, also coming from Nginx Inc.
Submitted by:	ru
2012-06-04 14:18:13 +00:00
glebius
df2b290f0d Optimise kern_sendfile(): skip cycling through the entire mbuf chain in
m_cat(), storing pointer to last mbuf in chain in local variable and
attaching new mbuf to the end of chain.

Submitter reports that CPU load dropped for > 10% on a web server
serving large files with this optimisation.

Submitted by:	Sergey Budnevitch <sb nginx.com>
2012-06-04 12:49:21 +00:00
melifaro
511c0436a1 Fix panic introduced by r235745. Panic occurs after first packet traverse renamed interface.
Add several comments on locking

Found by:         avg
Approved by:      ae(mentor)
Tested by:        avg
MFC after:        1 week
2012-06-04 12:36:58 +00:00
mav
fb116304c2 Add -p argument for camcontrol debug to allow enabling CAM_DEBUG_PROBE
added at r208911.
2012-06-04 10:42:09 +00:00
mav
e5ff9bbfd5 Remove some dead code that I doubt will ever be implemented. 2012-06-04 09:47:19 +00:00
trociny
3092b09c77 Document -r option in SYNOPSIS and usage statement.
Submitted by:	Andrey Zonov <andrey zonov.org>
MFC after:	3 days
2012-06-04 09:25:01 +00:00
trociny
1300b8151a On a child exit, call waitpid(2) to clean up the process table.
Submitted by:	Andrey Zonov <andrey zonov.org>
MFC after:	1 week
2012-06-04 09:22:22 +00:00
gber
d15be0fc1f Restore changes accidentally removed in r235537.
Noticed by:	avg
2012-06-04 08:40:14 +00:00
imp
7670aa6951 Eliminate the now-unused AT91C_MASTER_CLOCK option and change the one
place in the source it was used to the more correct AT91C_MAIN_CLOCK.
Sort AT91C_MAIN_CLOCK into a better location in the options.arm file.
2012-06-04 04:24:59 +00:00
alc
93b7cabc81 Various small changes to PV entry management:
Constify pc_freemask[].

pmap_pv_reclaim()
  Eliminate "freemask" because it was a pessimization.  Add a comment about
  the resident count adjustment.

free_pv_entry() [i386 only]
  Merge an optimization from amd64 (r233954).

get_pv_entry()
  Eliminate the move to tail of the pv_chunk on the global pv_chunks list.
  (The right strategy needs more thought.  Moreover, there were unintended
  differences between the amd64 and i386 implementation.)

pmap_remove_pages()
  Eliminate unnecessary ()'s.
2012-06-04 03:51:08 +00:00
marius
f32938acd9 Disable verification of the flashed content for now; for reasons unknown
it sometimes causes physwr to hang.
2012-06-03 21:03:16 +00:00
dim
a0a31e8b37 During buildworld and buildkernel, define EARLY_BUILD in the earlier
stages (build-tools, cross-tools, etc) of the build, so we can detect in
bsd.*.mk whether to pass compiler-specific flags to ${CC}.

In particular, this commit will allow using WITH_CLANG_IS_CC when the
base compiler is still gcc, and when ${CC}, ${CXX} and ${CPP} are left
at their defaults.  The early stages will then be built using gcc, and
no clang-specific flags will be passed to it.  The later stages will be
built as usual.

The EARLY_BUILD define can also serve other uses, such as building the
world stage C++ executables with libc++ instead of libstdc++: during the
early build stages, we cannot assume libc++ is already available, so we
must still build with libstdc++ at that time.

MFC after:	1 week
2012-06-03 20:35:41 +00:00
imp
c875946e79 Minor rearrangement of the locore <-> initarm interface. Pass in a
structure with the first 4 registers to allow a wider range of boot
loaders to work.  Future commits will make use of this to centralize
support for the different loaders.
2012-06-03 18:34:32 +00:00
tuexen
aca0d1e392 Remove code which is not needed.
MFC after: 3 days
2012-06-03 18:14:57 +00:00
kib
472101ae88 Add a knob to disable vn_io_fault.
MFC after:	1 month
2012-06-03 16:19:37 +00:00
kib
d977144831 Count and export the number of prefaulting happen.
MFC after:	 1 month
2012-06-03 16:06:56 +00:00
tuexen
39dac9db3f Use an existing function to get the source address.
MFC after: 3 days
2012-06-03 14:54:50 +00:00
uqs
0490a3935d Fix make depend 2012-06-03 12:19:16 +00:00
joel
401c81aaa9 Minor spelling fixes. 2012-06-03 11:29:48 +00:00
joel
2ca9c240e7 Minor mdoc improvements. 2012-06-03 11:09:51 +00:00
pjd
2143a387af Simplify the code by using snprlcat().
MFC after:	3 days
2012-06-03 10:50:46 +00:00
avg
136f4d257b cpucontrol: use CPUCTL_UPDATE ioctl on correct file descriptor
I guess that means that microcode update has never worked for AMD CPUs.
Please also note that only older AMD CPUs and micrcode file format are
supported anyway (pre 10h family).

MFC after:	1 week
2012-06-03 08:30:00 +00:00
avg
85a02186bc free wdog_kern_pat calls in post-panic paths from under SW_WATCHDOG
Those calls are useful with hardware watchdog drivers too.

MFC after:	3 weeks
2012-06-03 08:01:12 +00:00
joel
1ecf065a6c Minor mdoc improvements. 2012-06-03 07:45:42 +00:00
emax
0985bae1a6 Plug reference leak.
Interface routes are refcounted as packets move through the stack,
and there's garbage collection tied to it so that route changes can
safely propagate while traffic is flowing. In our setup, we weren't
changing or deleting any routes, but the refcounting logic in
ip6_input() was wrong and caused a reference leak on every inbound
V6 packet. This eventually caused a 32bit overflow, and the resulting
0 value caused the garbage collection to run on the active route.
That then snowballed into the panic.

Reviewed by:	scottl
MFC after:	3 days
2012-06-03 07:36:59 +00:00
joel
1a57e2d650 mdoc: add missing width argument to Bl -tag. 2012-06-03 06:57:47 +00:00
imp
d8faea2753 Remove stray repeated line... 2012-06-03 05:36:25 +00:00
marius
245e8ceaa3 - Now that the DataFlash related drivers work properly (at91_spi(4) since
r236495 and at45d(4) since r236496), enable them by default.
- Sort BOOTP options.
2012-06-03 01:07:55 +00:00
marius
8573447bb6 - Loop up to 3 seconds when waiting for a device to get ready. [1]
- Make the device description match the driver name.
- Identify the chip variant based on the JEDEC and use that information
  to use the proper values for page count, offset and size instead of
  hardcoding a AT45DB642x with 2^N byte page support disabled.
- Take advantage of bioq_takefirst().
- Given that CONTINUOUS_ARRAY_READ_HF (0x0b) command isn't even mentioned
  in Atmel's DataFlash Application Note, as suggested by the previous
  comment may not work on all all devices and actually doesn't properly
  on at least AT45DB321D (JEDEC 0x1f2701), rewrite at45d_task() to use
  CONTINUOUS_ARRAY_READ (0xe8) for reading instead. This rewrite is laid
  out in a way allowing to easily add support for BIO_DELETE later on.
- Add support for reads and writes not starting on a page boundary.
- Verify the flash content after writing.
- Let at45d_task() gracefully handle errors on SPI transfers and the
  device not becoming ready afterwards again. [1]
- Use DEVMETHOD_END. [1]
- Use NULL instead of 0 for pointers. [1]

Additional testing by:	Ian Lepore

Submitted by:	Ian Lepore [1]
MFC after:	1 week
2012-06-03 01:00:55 +00:00
marius
9edaefbc6b - Prepend the device description with "AT91" to reflect its nature. [1]
- Move DMA tag and map creature to at91_spi_activate() where the other
  resource allocation also lives. [1]
- Flesh out at91_spi_deactivate(). [1]
- Work around the "Software Reset must be Written Twice" erratum.
- For now, run the bus at the slowest speed possible in order to work
  around data corruption on transit even seen with 9 MHz on ETHERNUT5
  (15 MHz maximum) and AT45DB321D (20 MHz maximum). This also serves as
  a poor man's work-around for the "NPCSx rises if no data data is to be
  transmitted" erratum of RM9200. Being able to use the appropriate bus
  speed would require:
  1) Adding a proper work-around for the RM9200 bug consisting of taking
     the chip select control away from the SPI peripheral and managing it
     directly as a GPIO line.
  2) Taking the maximum frequencies supported by the actual board and the
     slave devices into account and basing the whole thing on the master
     clock instead of hardcoding a divisor as previously done.
  3) Fixing the above mentioned data corruption.
- KASSERT that TX/RX command and data sizes match on transfers.
- Introduce a mutex ensuring that only one child device is running a SPI
  transfer at a time. [1]
- Add preliminary, #ifdef'ed out support for setting the chip select. [1]
- Use the RX instead of the TX commando size when setting up the RX side
  of a transfer.
- For controllers having SPI_SR_TXEMPTY, i.e. !RM9200, also wait for the
  completion of the TX part of transfers before stopping the whole thing
  again.
- Use DEVMETHOD_END. [1]
- Use NULL instead of 0 for pointers. [1, partially]

Additional testing by:  Ian Lepore

Submitted by:   Ian Lepore [1]
MFC after:      1 week
2012-06-03 00:54:10 +00:00
alc
3b78f745b2 Isolate the global pv list lock from data and other locks to prevent false
sharing within the cache.
2012-06-02 22:14:10 +00:00
tuexen
6f6d510dc7 Honor sysctl for TTL.
MFC after: 3 days
2012-06-02 21:22:26 +00:00
tuexen
6984141938 Don't request data from the IPv6 layer, which is not used.
MFC after: 3 days
2012-06-02 20:53:23 +00:00
marius
b91038cd47 Add missing prototypes. While at it, sort them alphabetically.
MFC after:	3 days
2012-06-02 20:47:00 +00:00
marius
ab5d16b45a Remove nitems() now that it lives in <sys/param.h> since r236486. 2012-06-02 20:00:52 +00:00
marius
5ef7d2624d Take advantage of nitems().
MFC after:	3 days
2012-06-02 19:41:28 +00:00
kib
3c3d727c68 Fix typo [1]. Use commas to separate flag printouts, in style with
other parts of function.

Submitted by: bf [1]
MFC after:   1 week
2012-06-02 19:39:12 +00:00
marius
f77bb430b9 Add nitems(), a macro for determining the number of elements in a
statically-allocated array.

Obtained from:	OpenBSD (in principle)
MFC after:	3 days
2012-06-02 19:30:49 +00:00
kib
e32a51888c Update the print mask for decoding b_flags. Add print masks for
b_vflags and b_xflags_t and print them as well.

MFC after:   1 week
2012-06-02 18:44:40 +00:00
kib
5926081022 Use plain store for atomic_store_rel on x86, instead of implicitly
locked xchg instruction.  IA32 memory model guarantees that store has
release semantic, since stores cannot pass loads or stores.

Reviewed by:	  bde, jhb
Tested by:	  pho
MFC after:	  2 weeks
2012-06-02 18:10:16 +00:00
tuexen
532b670a50 Remove an unused parameter.
MFC after: 3 days
2012-06-02 13:13:38 +00:00
dim
4176aa17ae Install libcxxrt's C++ ABI and unwind headers. This is done in libc++'s
Makefile, so these headers go into the same destination directory as
libc++'s own headers, currently /usr/include/c++/v1.

MFC after:	3 days
2012-06-02 11:07:19 +00:00
joel
f2d65ab354 mdoc: minor Bl improvements. 2012-06-02 11:03:14 +00:00
dim
65208febe4 Tabify libcxxrt and libc++'s Makefiles.
MFC after:	3 days
2012-06-02 11:00:48 +00:00