Commit Graph

167185 Commits

Author SHA1 Message Date
Dimitry Andric
6512fa7aec Amend r228781 by also disabling -Warray-bounds warnings for the asr
module.

MFC after:	1 week
2011-12-24 17:54:58 +00:00
Kevin Lo
824be4a073 Discard local array based on return values.
Pointed out by:	uqs
Found with:	Coverity Prevent(tm)
CID:	10089
2011-12-24 15:49:52 +00:00
David Chisnall
d1b02beefa ...and actually install it.
Approved by:	dim (mentor)
2011-12-24 15:31:06 +00:00
David Chisnall
50af8167d6 Initial implementation of stdatomic.h. Works (at least in the parts that were
tested) with clang and gcc, and more efficiently with clang+a big out-of-tree
diff that I need to commit soon (once it's been tidied and reviewed a bit).

Large portions by: ed
Reviewed by:	ed
Approved by:	dim (mentor)
2011-12-24 15:17:01 +00:00
Dimitry Andric
e6b475640f Set WERROR= for the nve(4) module. This driver gives several warnings
with clang, which will probably never be fixed, as it is unmaintained,
and superseded by nfe(4).

MFC after:	1 week
2011-12-24 13:36:28 +00:00
Dimitry Andric
7afac0fdc8 Make another clang warning, -Wempty-body, non-fatal during kernel
builds.  All the instances of this warning in our tree are completely
harmless.  (Most of the empty bodies look to be used simply as reminder
for the developer to add something later.)

While here, assign to CWARNEXTRA with ?=, so it can be overridden
easily, if needed.

MFC after:	1 week
2011-12-24 13:30:15 +00:00
David Chisnall
5dc8e009ab Some GCC-compatibility definitions. Define clang's feature test pseudomacros
to always evaluate to 0 if we are using a compiler that doesn't implement them.
This lets us use the macros easily in standard headers (e.g. stdatomic.h, which
should be the subject of my next commit).

Approved by:	dim (mentor)
2011-12-24 13:28:49 +00:00
Marius Strobl
1496f65717 Update a comment to reflect reality and explain why we're using the
medany code model.
2011-12-24 12:28:23 +00:00
Marius Strobl
78dbe84377 On FreeBSD just use the MD5 implementation of libmd rather than that of
libcrypto so we don't need to relinquish csup when world is built without
OpenSSL.
2011-12-24 12:16:38 +00:00
Lawrence Stewart
6cedd609b7 Introduce the sysclock_getsnapshot() and sysclock_snap2bintime() KPIs. The
sysclock_getsnapshot() function allows the caller to obtain a snapshot of all
the system clock and timecounter state required to create time stamps at a later
point. The sysclock_snap2bintime() function converts a previously obtained
snapshot into a bintime time stamp according to the specified flags e.g. which
system clock, uptime vs absolute time, etc.

These KPIs enable useful functionality, including direct comparison of the
feedback and feed-forward system clocks and generation of multiple time stamps
with different formats from a single timecounter read.

Committed on behalf of Julien Ridoux and Darryl Veitch from the University of
Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward
Clock Synchronization Algorithms" project.

For more information, see http://www.synclab.org/radclock/

In collaboration with:	Julien Ridoux (jridoux at unimelb edu au)
2011-12-24 01:32:01 +00:00
Sergey Kandaurov
da914858e1 Fix LINT-VIMAGE build after r228814: use virtualized pf_pool_limits. 2011-12-24 00:23:27 +00:00
Oleksandr Tymoshenko
d42cc94633 - Enable usbus on octusb 2011-12-24 00:22:21 +00:00
Oleksandr Tymoshenko
5a312a4a9a - Set CF physical address base in sysinfo structure 2011-12-23 22:10:55 +00:00
Alexander Motin
c8c8fe876f Report stripeoffset as zero not stripesize if physical block is zero
aligned, same as it is done for ATA.
2011-12-23 20:59:13 +00:00
John Baldwin
f0d6c5caf0 Add post-VOP hooks for VOP_DELETEEXTATTR() and VOP_SETEXTATTR() and use
these to trigger a NOTE_ATTRIB EVFILT_VNODE kevent when the extended
attributes of a vnode are changed.

Note that OS X already implements this behavior.

Reviewed by:	rwatson
MFC after:	2 weeks
2011-12-23 20:11:37 +00:00
Alexander Motin
2789ec41bc Addition to r228808:
READ CD is a 12 byte command. So fill additional bytes and update CDB length
when patching READ(10).

MFC after:	1 month
2011-12-23 19:53:28 +00:00
Alexander Motin
f67daabb25 Use READ CAPACITY(16) to get information about device physical sectors.
As soon as not all devices support READ CAPACITY(16), automatically fall
back to READ CAPACITY(10) if CAM_REQ_INVALID or SSD_KEY_ILLEGAL_REQUEST
status returned.

It also provides first bits of information about Logical Block Provisioning
(aka UNMAP/TRIM) support by the device.
2011-12-23 19:12:02 +00:00
Luigi Rizzo
d0c7b0751a 1. don't use if_pspare directly, but through a macro WMA()
2. move a variable declaration at the beginning of a block
2011-12-23 16:03:57 +00:00
Luigi Rizzo
57bf0568e1 whitespace fixes (one missing newline, one extra tab) 2011-12-23 16:02:14 +00:00
Colin Percival
3e65b9c6e6 Fix a problem whereby a corrupt DNS record can cause named to crash. [11:06]
Add an API for alerting internal libc routines to the presence of
"unsafe" paths post-chroot, and use it in ftpd. [11:07]

Fix a buffer overflow in telnetd. [11:08]

Make pam_ssh ignore unpassphrased keys unless the "nullok" option is
specified. [11:09]

Add sanity checking of service names in pam_start. [11:10]

Approved by:    so (cperciva)
Approved by:    re (bz)
Security:       FreeBSD-SA-11:06.bind
Security:       FreeBSD-SA-11:07.chroot
Security:       FreeBSD-SA-11:08.telnetd
Security:       FreeBSD-SA-11:09.pam_ssh
Security:       FreeBSD-SA-11:10.pam
2011-12-23 15:00:37 +00:00
Dimitry Andric
2cd8464e4e Amend r228822 by not directly adding to CWARNFLAGS, but to an optional
CWARNEXTRA variable, which gets included into the initial CWARNFLAGS
setting.  This makes it easier to override CWARNFLAGS with completely
custom settings (including enabling any disabled warnings).

Reminded by:	arundel
MFC after:	1 week
2011-12-23 13:50:33 +00:00
Konstantin Belousov
75ff604a78 Optimize the common case of msyncing the whole file mapping with
MS_SYNC flag. The system must guarantee that all writes are finished
before syscalls returned. Schedule the writes in async mode, which is
much faster and allows the clustering to occur. Wait for writes using
VOP_FSYNC(), since we are syncing the whole file mapping.

Potentially, the restriction to only apply the optimization can be
relaxed by not requiring that the mapping cover whole file, as it is
done by other OSes.

Reported and tested by:	 az
Reviewed by: alc
MFC after:   2 weeks
2011-12-23 09:09:42 +00:00
Adrian Chadd
252b52fd58 Disable the code which hard-sets the LEDs on. This prevents the LED
state from correctly updating things.

The reference driver directly enables/disables the LED state as required,
rather than nailing it up like it currently is.  That'll have to come
later by adding some further HAL methods.

Obtained from:	Atheros
2011-12-23 09:09:10 +00:00
Adrian Chadd
b5e55cb397 Port over some more GPIO fixes from the atheros reference HAL.
* Bring the AR5416 GPIO mux mask code in line with the code from the
  HAL.

* Add HAL_DEBUG_GPIO debugging statements, to track what's going on.

* Add Kiwi GPIO specific changes for reading values back.

Obtained from:	Atheros
2011-12-23 08:53:22 +00:00
Martin Matuska
cfd8eb6299 Fix typo s/xz/libarchive/
Reported by:	Emil Mikulic (private e-mail)
MFC after:	12 days
2011-12-23 08:50:26 +00:00
Adrian Chadd
e81f85f155 Port over some GPIO and LED fixes.
* As a preparation for AR9287 GPIO support, add in the AR9287 GPIO mask.
* Fix the association mask values; these are post-shift values but were
  being shifted in twice. This resulted in some garbage being written
  in the wrong place and the link LED (at least on my d-link AR5416
  NIC) giving totally incorrect blink patterns.
2011-12-23 08:32:53 +00:00
Adrian Chadd
153bf8fbd3 Remove unused #define's.
Pointy hat to: adrian, for not properly reading things when he copied
  ar9285.h to ar9287.h.
2011-12-23 04:05:39 +00:00
Adrian Chadd
ee3219757a Rework this ugly mess that tries to handle reset serialisation.
Some users were reporting concurrent resets _were_ occuring - ie,
either two ath_reset()s ran at the same time (likely one on each CPU)
or ath_reset() versus ath_chan_change().

Instead, this now tries to grab the serialisation semaphore and will
pause() for a while if it fails. It will always eventually succeed though
and will log an error if it hits the recursion situation.

All of this stuff needs to die a horrible death at some point and be
replaced with a properly serialising method of programming this stuff
(eg using the net80211 taskqueue for all of this stuff.) The trouble
is figuring out how to handle the concurrent ioctl() based things without
introducing more LORs (which is another reason why I haven't just wrapped
all of this stuff in large, long-lived locks, a-la what Linux can get
away with.)

MFC after:	Absolutely, positively never.
2011-12-23 03:59:49 +00:00
Adrian Chadd
61c0c6fe76 Add in ath_ee_9287_print. 2011-12-23 02:57:18 +00:00
Adrian Chadd
6e0f116875 Make some more of the 11n specific code conditional.
This doesn't fix compilation w/out AH_SUPPORT_AR5416 as all of the software
aggregation support in if_ath_tx.c and 11n code in if_ath_tx_ht.c touches
the 11n specific fields. I'll work on that later.
2011-12-23 02:40:35 +00:00
Adrian Chadd
197d53c565 Add a temporary debugging statement in order to try and identify what's
going on with the occasional garbage rs_antenna field reported by AR9285
users.

I've discovered that the 11n NICs only fill out the entire RX status
descriptor on the final descriptor in an aggregate. Some of the fields
(notably RSSI) are complete nonsense for A-MPDU subframes. This may
be another example of this.

The driver doesn't currently toss out statistics for non-final aggregate
frames. It's likely that this should be done.

If any users hit this particular debugging message they should report it
immediately to freebsd-wireless@freebsd.org - please ensure you have
ATH_DEBUG enabled so it prints out the full receive descriptor.

PR:		kern/163312
2011-12-23 02:21:22 +00:00
Guy Helmer
6890d15663 Handle malloc failures in yplib.c.
PR:		bin/83349
2011-12-23 02:13:42 +00:00
Rick Macklem
f855a3c570 During investigation of an NFSv4 client crash reported by glebius@,
jhb@ spotted that nfscl_getstateid() might modify credentials when
called from nfsrpc_read() for the case where p != NULL, whereas
nfsrpc_read() only did a crdup() to get new credentials for p == NULL.
This bug was introduced by r195510, since pre-r195510 nfscl_getstateid()
only modified credentials for the p == NULL case. This patch modifies
nfsrpc_read()/nfsrpc_write() so that they do crdup() for the p != NULL case.
It is conceivable that this bug caused the crash reported by glebius@, but
that will not be determined for some time, since the crash occurred after
about 1month of operation.

Tested by:	glebius
Reviewed by:	jhb
MFC after:	2 weeks
2011-12-23 02:04:35 +00:00
Guy Helmer
53fc6e1e4d Handle failures to malloc memory to hold key or val copies.
PR:		bin/83348
2011-12-23 01:56:25 +00:00
Navdeep Parhar
e050eaa32a Fix return value of function.
Submitted by:	Dan McGregor <dan dot mcgregor at usask dot ca>
2011-12-23 01:39:10 +00:00
Glen Barber
0f13c0f4a8 Whitespace cleanup:
ar/ar.1:
 - Remove trailing whitespace

Reported by:		igor
MFC after:		1 week
X-MFC-With:		r228823
2011-12-23 00:31:26 +00:00
Glen Barber
dce762dd44 Formatting fixes:
hexdump/od.1:
 - Enclose tabbed content in quotes [1]

ar/ar.1:
 - Enclose tabbed content in quotes [1]

rctl/rctl.8:
 - Enclose tabbed content in quotes [1]
 - Start a sentence on a newline [2]

Reported by:		manlint [1], igor [2]
MFC after:		1 week
X-MFC-after:		9.0-RELEASE
2011-12-23 00:29:01 +00:00
Dimitry Andric
0ed78d642e When building the kernel with clang, it produces several warnings which
might be useful in some cases, but which are not severe enough to error
out the whole kernel build.  Display them anyway, so there is at least
some incentive to fix them eventually.

Start with -Wtautological-compare warnings.  These usually occur when
people check if unsigned quantities are negative, or similar cases.  To
clean these up would be painful, and might give problems if the base
type which is compared against changes to signed later on.

MFC after:	1 week
2011-12-23 00:23:37 +00:00
Alexander Motin
e66b36c6a7 Merge to da driver quirks hinting 4K physical sector sizes for SATA disks
connected via SAS or USB. Unluckily I've found that SAS (mps) and USB-SATA
I have translate models in different ways, requiring twice more quirks.
Unluckily for Hitachi, their model names are trimmed on SAS, making
impossible to identify 4K sector drives that way.
2011-12-23 00:10:17 +00:00
Alexander Motin
643d18260b Update list of 4K physical sector hard drives. 2011-12-22 23:50:31 +00:00
Dimitry Andric
f15dabe59d Disable various warnings for the ath module in a more fine-grained way:
only add the option for the specific .c files that need them, like via
sys/conf/files.

MFC after:	1 week
2011-12-22 23:40:52 +00:00
Adrian Chadd
ead079638f Use the correct types when calling the decompression mask function.
There's currently no public code which uses this feature and the
current reference driver doesn't enable this feature at all.
It's possible it was used by a previous version of the driver and
that indeed it should return HAL_STATUS; but at this point I'm
happy to require that they complain and submit a patch.

This was found by LLVM compile-time type checking.

Submitted by:	dim
2011-12-22 21:54:53 +00:00
Gleb Smirnoff
6bc752e028 Merge from OpenBSD:
revision 1.122
  date: 2009/05/13 01:01:34;  author: dlg;  state: Exp;  lines: +6 -4
  only keep track of the number of updates on tcp connections. state sync on
  all the other protocols is simply pushing the timeouts along which has a
  resolution of 1 second, so it isnt going to be hurt by pfsync taking up
  to a second to send it over.

  keep track of updates on tcp still though, their windows need constant
  attention.
2011-12-22 19:09:55 +00:00
Gleb Smirnoff
2662e31fc3 Merge from OpenBSD:
revision 1.120
  date: 2009/04/04 13:09:29;  author: dlg;  state: Exp;  lines: +5 -5
  use time_uptime instead of time_second internally. time_uptime isnt
  affected by adjusting the clock.

  revision 1.175
  date: 2011/11/25 12:52:10;  author: dlg;  state: Exp;  lines: +3 -3
  use time_uptime to set state creation values as time_second can be
  skewed at runtime by things like date(1) and ntpd. time_uptime is
  monotonic and therefore more useful to compare against.
2011-12-22 19:05:58 +00:00
Gleb Smirnoff
e3b670692a Merge couple more fixes from OpenBSD to bulk processing:
revision 1.118
  date: 2009/03/23 06:19:59;  author: dlg;  state: Exp;  lines: +8 -6
  wait an appropriate amount of time before giving up on a bulk update,
  rather than giving up after a hardcoded 5 seconds (which is generally much
  too short an interval for a bulk update).
  pointed out by david@, eyeballed by mcbride@

  revision 1.171
  date: 2011/10/31 22:02:52;  author: mikeb;  state: Exp;  lines: +2 -1
  Don't forget to cancel bulk update failure timeout when destroying an
  interface.  Problem report and fix from Erik Lax, thanks!

Start a brief note of revisions merged from OpenBSD.
2011-12-22 18:56:27 +00:00
Gleb Smirnoff
c5360c2998 We really mean MTU of the real interface here, not of our pseudo. 2011-12-22 18:51:35 +00:00
Gleb Smirnoff
1c435c73a1 Use a better log message for master down event. 2011-12-22 18:48:21 +00:00
Gleb Smirnoff
538c3a7cd0 In FreeBSD we always have bpf(4) API, either real or stub. No need
in detecting presense of 'device bpf'.
2011-12-22 18:31:47 +00:00
Dag-Erling Smørgrav
d9ecbdf39e Merge upstream r509: don't log an error in the common case (ENOENT). 2011-12-22 18:12:51 +00:00
Dag-Erling Smørgrav
9b171ba819 Merge upstream r509: don't log an error in the common case (ENOENT). 2011-12-22 18:10:15 +00:00