]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoMake more code be protected by internal mutex, and now it is fork-safe, in
davidxu [Sun, 17 Feb 2013 02:52:42 +0000 (02:52 +0000)]
Make more code be protected by internal mutex, and now it is fork-safe, in
error case, the file exclusive lock is now released as soon as possible,
in previous code, child process can still hold the exclusive lock.

11 years agoIn kthr.c, obtain the address of the PCB for threads that were running
marcel [Sun, 17 Feb 2013 02:15:19 +0000 (02:15 +0000)]
In kthr.c, obtain the address of the PCB for threads that were running
on a core, when the core was stopped, by calling kgdb_trgt_core_pcb().
This has 2 advantages:
1.  We don't need to include a machine-specific header anymore and as
    such kthr.c is truly machine independent. This allows the code to
    be used in a cross-debugger.
2.  We don't need to lookup stoppcbs in generic code when it's an
    inherently target-spicific symbol. It does not exist for ia64.

Implement kgdb_trgt_core_pcb() for all architectures, except ia64, by
calling a common function called kgdb_trgt_stop_pcb(). This function
differs from kgdb_trgt_core_pcb() in that it gets the size of the PCB
structure as an argument and as such remains machine independent.

On ia64 the PCB for stopped cores is in the PCPU structure itself.
This for better scaling. The implementation of kgdb_trgt_core_pcb()
for ia64 uses the cpuid_to_pcpu[] array to to obtain the address of
the PCB structure.

11 years agoRemove accidentally committed debug panic(9) call
gonzo [Sun, 17 Feb 2013 01:34:25 +0000 (01:34 +0000)]
Remove accidentally committed debug panic(9) call

11 years agoClose a race relating to setting the PCPU pointer (r13). Register r13
marcel [Sun, 17 Feb 2013 00:51:34 +0000 (00:51 +0000)]
Close a race relating to setting the PCPU pointer (r13). Register r13
points to the TLS in user space and points to the PCPU structure in
the kernel. The race is the result of having the exception handler on
the one hand and the RPC system call entry on the other. The EPC
syscall path is non-atomic in that interrupts are enabled while the
two stacks are switched. The register stack is switched last as that
is the stack used to determine whether we're going back to user space
by the exception handler. If we go back to user space, we restore r13,
otherwise we leave r13 alone. The EPC syscall path however set r13 to
the PCPU structure *before* switching the register stack, which means
that there was a window in which the exception handler would restore
r13 when it was already pointing to the PCPU structure. This is fatal
when the exception happened on CPU x, but left from the exception on
anotehr CPU. In that case r13 would point to the PCPU of the CPU the
thread was running on. This immediately results in getting the wrong
value for curthread.
The fix is to make sure we assign r13 *after* we set ar.bspstore to
point to the kernel register stack for the thread.

11 years ago- Add hw.bcm2835.sdhci.hs tunable to enable/disable highspeed mode in
gonzo [Sun, 17 Feb 2013 00:23:42 +0000 (00:23 +0000)]
- Add hw.bcm2835.sdhci.hs tunable to enable/disable highspeed mode in
    SDHCI driver
  Suggested by: Daisuke Aoyama

- Set initilization sequence frequency to 8MHz. It should fix Data CRC
    errors. Standard requires initialization sequence to be executed
    at 400KHz but on this hardware low frequncies seems to cause
    Data CRC errors.

    Value was derived from analyzing hardware signals after
    Raspberry Pi is powered up. Before any data is read though DATA line
    adapter's clock frequency is changed to 8MHz.

    Modern cards should function fine at 8MHz but for older MMC cards it
    can be overriden by setting hw.bcm2835.sdhci.min_freq tunable.

11 years agoDisable debug accidentally enabled by previous commit
gonzo [Sat, 16 Feb 2013 23:52:14 +0000 (23:52 +0000)]
Disable debug accidentally enabled by previous commit

11 years agoVarious timing-related fixes:
gonzo [Sat, 16 Feb 2013 23:12:06 +0000 (23:12 +0000)]
Various timing-related fixes:

- Replace divisor numbers with more descirptive names
- Properly calculate minimum frequency for SDHCI 3.0
- Properly calculate frequency for SDHCI 3.0 in mmcbr_set_clock
- Add min_freq method to sdhci_if.m and provide default
  implementation.  By re-implementing this method hardware
  drivers can control frequency controller operates when
  executing initialization sequence

11 years agoPut one file per line so it is easier to read diffs against those files.
pjd [Sat, 16 Feb 2013 22:21:46 +0000 (22:21 +0000)]
Put one file per line so it is easier to read diffs against those files.

11 years ago#if out unused functions which trip up gcc but not clang.
des [Sat, 16 Feb 2013 22:16:14 +0000 (22:16 +0000)]
#if out unused functions which trip up gcc but not clang.

11 years agoReturn EFAULT when the address is not a kernel virtual address.
marcel [Sat, 16 Feb 2013 21:46:27 +0000 (21:46 +0000)]
Return EFAULT when the address is not a kernel virtual address.

11 years agoIn _bus_dmamap_addseg(), the return value must be zero for error, or the size
ian [Sat, 16 Feb 2013 20:43:16 +0000 (20:43 +0000)]
In _bus_dmamap_addseg(), the return value must be zero for error, or the size
actually added to the segment (possibly smaller than the requested size if
boundary crossings had to be avoided).

11 years agoSince clang 3.2 now has an option to suppress warnings about implicitly
dim [Sat, 16 Feb 2013 20:17:31 +0000 (20:17 +0000)]
Since clang 3.2 now has an option to suppress warnings about implicitly
promoted K&R parameters, remove the workarounds added for sendmail
components in r228558.

MFC after: 1 week

11 years ago* Reduce the PCU lock overhead a little by only re-acquiring it if we
adrian [Sat, 16 Feb 2013 19:11:57 +0000 (19:11 +0000)]
* Reduce the PCU lock overhead a little by only re-acquiring it if we
  actually do have to reinitialise the RX side of things after an RX
  descriptor EOL error.

* Revert a change of mine from quite a while ago - don't shortcut the
  RX initialisation path.  There's a RX FIFO bug in the earlier chips
  (I'm not sure when it was fixed in this series, but it's fixed
  with the AR9380 and later) which causes the same RX descriptor to
  be written to over and over.  This causes the descriptor to be
  marked as "done", and this ends up causing the whole RX path to
  go very strange.  This should fixed the "kickpcu; handled X packets"
  message spam where "X" is consistently small.

11 years agoThe UFS2 filesystem allocates new blocks of inodes as they are needed.
mckusick [Sat, 16 Feb 2013 15:11:40 +0000 (15:11 +0000)]
The UFS2 filesystem allocates new blocks of inodes as they are needed.
When a cylinder group runs short of inodes, a new block for inodes is
allocated, zero'ed, and written to the disk. The zero'ed inodes must
be on the disk before the cylinder group can be updated to claim them.
If the cylinder group claiming the new inodes were written before the
zero'ed block of inodes, the system could crash with the filesystem in
an unrecoverable state.

Rather than adding a soft updates dependency to ensure that the new
inode block is written before it is claimed by the cylinder group
map, we just do a barrier write of the zero'ed inode block to ensure
that it will get written before the updated cylinder group map can
be written. This change should only slow down bulk loading of newly
created filesystems since that is the primary time that new inode
blocks need to be created.

Reported by: Robert Watson
Reviewed by: kib
Tested by:   Peter Holm

11 years agoAdd barrier write capability to the VFS buffer interface. A barrier
mckusick [Sat, 16 Feb 2013 14:51:30 +0000 (14:51 +0000)]
Add barrier write capability to the VFS buffer interface. A barrier
write is a disk write request that tells the disk that the buffer
being written must be committed to the media along with any writes
that preceeded it before any future blocks may be written to the drive.

Barrier writes are provided by adding the functions bbarrierwrite
(bwrite with barrier) and babarrierwrite (bawrite with barrier).

Following a bbarrierwrite the client knows that the requested buffer
is on the media. It does not ensure that buffers written before that
buffer are on the media. It only ensure that buffers written before
that buffer will get to the media before any buffers written after
that buffer. A flush command must be sent to the disk to ensure that
all earlier written buffers are on the media.

Reviewed by: kib
Tested by:   Peter Holm

11 years agoImport change 40eebf235370b6fe6353784ccf01ab92eed062a5 from upstream wpa:
dim [Sat, 16 Feb 2013 12:52:40 +0000 (12:52 +0000)]
Import change 40eebf235370b6fe6353784ccf01ab92eed062a5 from upstream wpa:

  From: Jouni Malinen <j@w1.fi>
  Date: Fri, 15 Jul 2011 13:42:06 +0300
  Subject: [PATCH] MD5: Fix clearing of temporary stack memory to use correct length

  sizeof of the structure instead of the pointer was supposed to be used
  here. Fix this to clear the full structure at the end of MD5Final().

Found by: clang ToT
Reviewed by: rpaulo
MFC after: 3 days

11 years agoFix two instances of undefined behaviour in contrib/nvi.
dim [Sat, 16 Feb 2013 12:48:06 +0000 (12:48 +0000)]
Fix two instances of undefined behaviour in contrib/nvi.

Found by: clang ToT
Obtained from: NetBSD
Reviewed by: jh
MFC after: 3 days

11 years agoIn contrib/opie/opiekey.c, use the correct length to zero the secret.
dim [Sat, 16 Feb 2013 12:45:57 +0000 (12:45 +0000)]
In contrib/opie/opiekey.c, use the correct length to zero the secret.

Found by: clang ToT
Reviewed by: delphij
MFC after: 3 days

11 years agoSimplify code by using flag O_EXLOCK.
davidxu [Sat, 16 Feb 2013 06:07:07 +0000 (06:07 +0000)]
Simplify code by using flag O_EXLOCK.

PR: kern/175674

11 years agoFix an incorrect sizeof()
adrian [Sat, 16 Feb 2013 00:12:21 +0000 (00:12 +0000)]
Fix an incorrect sizeof()

Spotted by: clang

Submitted by: dim

11 years agoFix undefined behaviour in usr.bin/mail/util.c.
dim [Fri, 15 Feb 2013 23:59:57 +0000 (23:59 +0000)]
Fix undefined behaviour in usr.bin/mail/util.c.

Reported by: deeptech71@gmail.com
MFC after: 3 days

11 years agoSet map->pmap before _bus_dmamap_count_pages() tries to use it.
ian [Fri, 15 Feb 2013 23:41:47 +0000 (23:41 +0000)]
Set map->pmap before _bus_dmamap_count_pages() tries to use it.

Obtained from: Thomas Skibo <ThomasSkibo@sbcglobal.net>

11 years agoPull in r175057 from upstream llvm trunk:
dim [Fri, 15 Feb 2013 23:12:58 +0000 (23:12 +0000)]
Pull in r175057 from upstream llvm trunk:

  X86: Disable generation of rep;movsl when %esi is used as a base pointer.

  This happens when there is both stack realignment and a dynamic alloca in the
  function. If we overwrite %esi (rep;movsl uses fixed registers) we'll lose the
  base pointer and the next register spill will write into oblivion.

  Fixes PR15249 and unbreaks firefox on i386/freebsd. Mozilla uses dynamic allocas
  and freebsd a 4 byte stack alignment.

MFC after: 1 week

11 years agoRegenerate libstdc++'s config.h, synchronizing it with our current
dim [Fri, 15 Feb 2013 23:12:35 +0000 (23:12 +0000)]
Regenerate libstdc++'s config.h, synchronizing it with our current
almost-C99 headers.

MFC after: 1 week

11 years agoRevert r227528 and r227787. This hack is no longer necessary since r233580.
jkim [Fri, 15 Feb 2013 22:58:44 +0000 (22:58 +0000)]
Revert r227528 and r227787.  This hack is no longer necessary since r233580.

11 years agoConsistently use round_page(x) rather than roundup(x, PAGE_SIZE). There is
jkim [Fri, 15 Feb 2013 22:43:08 +0000 (22:43 +0000)]
Consistently use round_page(x) rather than roundup(x, PAGE_SIZE).  There is
no functional change.

11 years agoUpgrade to 1.6.16
des [Fri, 15 Feb 2013 21:49:12 +0000 (21:49 +0000)]
Upgrade to 1.6.16

11 years agoAdd generated files
des [Fri, 15 Feb 2013 21:33:05 +0000 (21:33 +0000)]
Add generated files

11 years agofix leftover from an earlier experiment
des [Fri, 15 Feb 2013 21:31:01 +0000 (21:31 +0000)]
fix leftover from an earlier experiment

11 years agoEnable USB1 (which is EHCI0) for Allwinner A10
gonzo [Fri, 15 Feb 2013 21:29:03 +0000 (21:29 +0000)]
Enable USB1 (which is EHCI0) for Allwinner A10

Tested by: ganbold@

11 years agoFix copy-paste error in bus_space_unmap argument
gonzo [Fri, 15 Feb 2013 21:24:21 +0000 (21:24 +0000)]
Fix copy-paste error in bus_space_unmap argument

While I'm at it - fix some style(9) issues

Submitted by: Mikael Urankar

11 years agoMerge ACPICA 20130214.
jkim [Fri, 15 Feb 2013 20:36:28 +0000 (20:36 +0000)]
Merge ACPICA 20130214.

11 years agoImport ACPICA 20130215.
jkim [Fri, 15 Feb 2013 19:12:35 +0000 (19:12 +0000)]
Import ACPICA 20130215.

11 years agoAdvertise PCI-E capability in the hostbridge device presented to the guest.
neel [Fri, 15 Feb 2013 18:41:36 +0000 (18:41 +0000)]
Advertise PCI-E capability in the hostbridge device presented to the guest.

FreeBSD wants to see this capability in at least one device in the PCI
hierarchy before it allows use of MSI or MSI-X.

Obtained from: NetApp

11 years agoAdd PPS_CANWAIT support for time_pps_fetch(). This adds support for all three
ian [Fri, 15 Feb 2013 18:30:32 +0000 (18:30 +0000)]
Add PPS_CANWAIT support for time_pps_fetch().  This adds support for all three
blocking modes described in section 3.4.3 of RFC 2783, allowing the caller
to retrieve the most recent values without blocking, to block for a specified
time, or to block forever.

Reviewed by: discussion on hackers@

11 years agoManually add the correct text for the LDNS and LDNS_UTILS options.
des [Fri, 15 Feb 2013 15:09:24 +0000 (15:09 +0000)]
Manually add the correct text for the LDNS and LDNS_UTILS options.
There seems to be a bug in makeman that causes it to misunderstand
the relationship between LDNS_UTILS and BIND_UTILS.

11 years agoThe relationship between LDNS_UTILS and BIND_UTILS was inverted.
des [Fri, 15 Feb 2013 14:22:23 +0000 (14:22 +0000)]
The relationship between LDNS_UTILS and BIND_UTILS was inverted.

11 years agovn_io_faults_cnt:
pluknet [Fri, 15 Feb 2013 14:22:05 +0000 (14:22 +0000)]
vn_io_faults_cnt:
- use u_long consistently
- use SYSCTL_ULONG to match the type of variable

Reviewed by: kib
MFC after: 1 week

11 years agoUpdate src.conf(5) up to but not including my LDNS commits.
des [Fri, 15 Feb 2013 14:17:27 +0000 (14:17 +0000)]
Update src.conf(5) up to but not including my LDNS commits.

11 years agoOops, I flipped LDNS_UTILS but forgot to update the description.
des [Fri, 15 Feb 2013 13:57:51 +0000 (13:57 +0000)]
Oops, I flipped LDNS_UTILS but forgot to update the description.

11 years agoimport ldns 1.6.16
des [Fri, 15 Feb 2013 13:51:54 +0000 (13:51 +0000)]
import ldns 1.6.16

11 years agoImport LDNS and build it as an internal library.
des [Fri, 15 Feb 2013 13:44:18 +0000 (13:44 +0000)]
Import LDNS and build it as an internal library.

11 years agoAdd support of passing SCM_BINTIME ancillary data object for PF_LOCAL
pluknet [Fri, 15 Feb 2013 13:00:20 +0000 (13:00 +0000)]
Add support of passing SCM_BINTIME ancillary data object for PF_LOCAL
sockets.

PR: kern/175883
Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
Discussed with: glebius, phk
MFC after: 2 weeks

11 years agosetbuf(3): Remove bugs section about ancient versions of BSD.
jilles [Fri, 15 Feb 2013 10:44:07 +0000 (10:44 +0000)]
setbuf(3): Remove bugs section about ancient versions of BSD.

11 years agoRemove write only assignments and thus fix the build after struct bufarea
pluknet [Fri, 15 Feb 2013 09:10:01 +0000 (09:10 +0000)]
Remove write only assignments and thus fix the build after struct bufarea
TAILQ conversion (r246812).

11 years agoFinish the r244185. This fixes ever growing counter of pfsync bad
glebius [Fri, 15 Feb 2013 09:03:56 +0000 (09:03 +0000)]
Finish the r244185. This fixes ever growing counter of pfsync bad
length packets, which was actually harmless.

Note that peers with different version of head/ may grow this
counter, but it is harmless - all pfsync data is processed.

Reported & tested by: Anton Yuzhaninov <citrin citrin.ru>
Sponsored by: Nginx, Inc

11 years agoFix compilation warning.
glebius [Fri, 15 Feb 2013 07:58:51 +0000 (07:58 +0000)]
Fix compilation warning.

Sponsored by: Nginx, Inc

11 years agoUpdate fsck_ffs buffer cache manager to use TAILQ macros.
mckusick [Fri, 15 Feb 2013 01:00:48 +0000 (01:00 +0000)]
Update fsck_ffs buffer cache manager to use TAILQ macros.
No functional changes.

11 years agoChange examples to be consistent with what style(9) says.
zeising [Thu, 14 Feb 2013 21:29:55 +0000 (21:29 +0000)]
Change examples to be consistent with what style(9) says.

Approved by: joel (mentor)
MFC After: 2 weeks

11 years agoEliminate real_LZ4_uncompress. It's unused and does not perform sufficient
delphij [Thu, 14 Feb 2013 21:02:18 +0000 (21:02 +0000)]
Eliminate real_LZ4_uncompress.  It's unused and does not perform sufficient
check against input stream (i.e. it could read beyond specified input
buffer).

11 years agoMesh: QoS Control field bit flags fix.
monthadar [Thu, 14 Feb 2013 20:00:38 +0000 (20:00 +0000)]
Mesh: QoS Control field bit flags fix.

* The following bit flags where incroccetly defined:
    o Mesh Control Present
    o Mesh Power Save Level
    o RSPI
  This is now corrected according to Table 8.4 as per IEEE 802.11 2012;

Approved by: adrian (mentor)

11 years agoFix date.
joel [Thu, 14 Feb 2013 19:46:41 +0000 (19:46 +0000)]
Fix date.

11 years agoMake VM_NDOMAIN a kernel option so that it can be enabled from a kernel
jhb [Thu, 14 Feb 2013 19:38:04 +0000 (19:38 +0000)]
Make VM_NDOMAIN a kernel option so that it can be enabled from a kernel
config file.

Requested by: phk (ages ago)
MFC after: 1 month

11 years agoHandle (ignore) when a process disappears before it can be tracked.
jamie [Thu, 14 Feb 2013 19:27:52 +0000 (19:27 +0000)]
Handle (ignore) when a process disappears before it can be tracked.

11 years agoFreeBSD uses #if __BSD_VISIBLE to hide non-standard functions, fix this.
zeising [Thu, 14 Feb 2013 19:26:58 +0000 (19:26 +0000)]
FreeBSD uses #if __BSD_VISIBLE to hide non-standard functions, fix this.

Noticed by: kib
Approved by: kib

11 years agoPrint slightly more useful information on the 'bad pte' panic.
kib [Thu, 14 Feb 2013 19:22:15 +0000 (19:22 +0000)]
Print slightly more useful information on the 'bad pte' panic.

No objections from: alc
MFC after: 1 week

11 years agoAssert that user address is never qremoved.
kib [Thu, 14 Feb 2013 19:21:20 +0000 (19:21 +0000)]
Assert that user address is never qremoved.

No objections from: alc
MFC after: 1 week

11 years agoAdd option "--unassign-pptdev=<bus/slot/func>" to allow 'bhyvectl' to detach
neel [Thu, 14 Feb 2013 18:41:12 +0000 (18:41 +0000)]
Add option "--unassign-pptdev=<bus/slot/func>" to allow 'bhyvectl' to detach
passthru devices from the guest.

Obtained from: NetApp

11 years agoResolve issue that caused WITNESS to report LORs.
jpaetzel [Thu, 14 Feb 2013 17:34:17 +0000 (17:34 +0000)]
Resolve issue that caused WITNESS to report LORs.

PR: kern/171838
Submitted by: Venkat Duvvuru <venkatduvvuru.ml@gmail.com>
MFC after: 2 weeks

11 years agoRevert r246791 as it needs a security review first
bapt [Thu, 14 Feb 2013 15:17:53 +0000 (15:17 +0000)]
Revert r246791 as it needs a security review first

Reported by: gavin, rwatson

11 years agoremove old-style function definition
charnier [Thu, 14 Feb 2013 14:44:08 +0000 (14:44 +0000)]
remove old-style function definition
reduce WARNS=6 output

11 years agoAllow fdescfs to be mounted from inside a jail
bapt [Thu, 14 Feb 2013 13:03:15 +0000 (13:03 +0000)]
Allow fdescfs to be mounted from inside a jail

MFC after: 1 week

11 years agoIn case of failure of the pkg boostrap advice the user to either change the
bapt [Thu, 14 Feb 2013 12:42:09 +0000 (12:42 +0000)]
In case of failure of the pkg boostrap advice the user to either change the
PACKAGESITE they use or install from ports directly indicating where the port
is localted in the port collection

Submitted by: kientzle

11 years agoAdd USB API to read power draw on USB devices.
hselasky [Thu, 14 Feb 2013 12:22:40 +0000 (12:22 +0000)]
Add USB API to read power draw on USB devices.
Update usbconfig to print power draw on USB devices.

MFC after: 2 weeks
Submitted by: Matt Burke @ icritical.com

11 years ago- Fix libmd dependency. It is needed in the bootstrap library list because
hrs [Thu, 14 Feb 2013 08:32:07 +0000 (08:32 +0000)]
- Fix libmd dependency.  It is needed in the bootstrap library list because
  usr.bin/xinstall depends on it.
- Remove libutil from usr.bin/xinstall/Makefile.  No symbol was actually used.

Reviewed by: brooks

11 years agorework old-style functions prototypes
charnier [Thu, 14 Feb 2013 08:16:03 +0000 (08:16 +0000)]
rework old-style functions prototypes
reduce WARNS=6 output

11 years agoSimplify r243637 and make sure that nfsdargs.{min,max}threads are always set
delphij [Thu, 14 Feb 2013 02:00:41 +0000 (02:00 +0000)]
Simplify r243637 and make sure that nfsdargs.{min,max}threads are always set
to meaningful value:

 - When nfsdcnt is set, it dictates all values;
 - Otherwise, nfsdargs.minthreads is set to user specified value, or the
   automatically detected value if there is no one specified;
   nfsdargs.maxthreads is set to the user specified value, or the value
   of nfsdargs.minthreads if there is no one specified; when it is smaller
   than nfsdargs.minthreads, the latter's value is always used.

MFC after: 2 weeks

11 years agoAbstract out setting of nfsdcnt and consistently use MAXNFSDCNT when the
delphij [Thu, 14 Feb 2013 01:25:14 +0000 (01:25 +0000)]
Abstract out setting of nfsdcnt and consistently use MAXNFSDCNT when the
proposed value is too high and DEFNFSDCNT when proposed value is too low.

MFC after: 2 weeks

11 years agoUse static for all functions that do not need to be exported.
delphij [Thu, 14 Feb 2013 01:01:53 +0000 (01:01 +0000)]
Use static for all functions that do not need to be exported.

MFC after: 2 weeks

11 years agoRequests for invalid CPUID leaves should map to the highest known leaf instead.
neel [Wed, 13 Feb 2013 23:22:17 +0000 (23:22 +0000)]
Requests for invalid CPUID leaves should map to the highest known leaf instead.

Reviewed by: grehan
Obtained from: NetApp

11 years agoChange vfs.zfs.write_to_degraded from CTLFLAG_RW to CTLFLAG_RWTUN
mm [Wed, 13 Feb 2013 23:11:25 +0000 (23:11 +0000)]
Change vfs.zfs.write_to_degraded from CTLFLAG_RW to CTLFLAG_RWTUN

Suggested by: pjd

11 years agoMerge OpenSSL 1.0.1e.
jkim [Wed, 13 Feb 2013 23:07:20 +0000 (23:07 +0000)]
Merge OpenSSL 1.0.1e.

Approved by: secteam (simon), benl (silence)

11 years agoChange "the the" to "the". It is a continuation of r226436 and missed in
jkim [Wed, 13 Feb 2013 22:38:20 +0000 (22:38 +0000)]
Change "the  the" to "the".  It is a continuation of r226436 and missed in
r237658.

Approved by: benl (maintainer, implicit)

11 years agoImport OpenSSL 1.0.1e.
jkim [Wed, 13 Feb 2013 22:15:56 +0000 (22:15 +0000)]
Import OpenSSL 1.0.1e.

Approved by: secteam (delphij, simon), benl (silence)

11 years agoRestore De Bruijn algorithm for sparc64 where the compiler rely on a
delphij [Wed, 13 Feb 2013 17:30:54 +0000 (17:30 +0000)]
Restore De Bruijn algorithm for sparc64 where the compiler rely on a
library function for __builtin_c?z.

Tested by: Michael Moll <kvedulv kvedulv de>

11 years agoAdd strchrnul(), a GNU function similar to strchr(), except that it returns
zeising [Wed, 13 Feb 2013 15:46:33 +0000 (15:46 +0000)]
Add strchrnul(), a GNU function similar to strchr(), except that it returns
a pointer to the end of the string, rather than NULL, if the character was
not found.

Approved by: theraven

11 years agoRemove unused variable.
hselasky [Wed, 13 Feb 2013 15:43:15 +0000 (15:43 +0000)]
Remove unused variable.

MFC after: 1 week

11 years agoAdd a dependency so that when compiling in a static dtb, the kernel gets
ian [Wed, 13 Feb 2013 15:13:47 +0000 (15:13 +0000)]
Add a dependency so that when compiling in a static dtb, the kernel gets
re-linked after changing the .dts source.

Reviewed by: cognet, arm@

11 years agoMake the F_READAHEAD option to fcntl(2) work as documented: a value of zero
ian [Wed, 13 Feb 2013 15:09:16 +0000 (15:09 +0000)]
Make the F_READAHEAD option to fcntl(2) work as documented:  a value of zero
now disables read-ahead.  It used to effectively restore the system default
readahead hueristic if it had been changed; a negative value now restores
the default.

Reviewed by: kib

11 years agoResolve a LOR after r246616. Protect control requests using the USB device
hselasky [Wed, 13 Feb 2013 12:35:17 +0000 (12:35 +0000)]
Resolve a LOR after r246616. Protect control requests using the USB device
enumeration lock. Make sure all callers of usbd_enum_lock() check the return
value. Remove the control transfer specific lock. Bump the FreeBSD version
number, hence external USB modules may need to be recompiled due to a USB
device structure change.

MFC after: 1 week

11 years agoAdd new USB ID to FTDI driver.
hselasky [Wed, 13 Feb 2013 08:28:27 +0000 (08:28 +0000)]
Add new USB ID to FTDI driver.

MFC after: 1 week
PR: kern/175893
Submitted by: Tomek

11 years agoAdd specific supported revision of D-Link DWA-140 rev B1, B2.
hselasky [Wed, 13 Feb 2013 08:20:29 +0000 (08:20 +0000)]
Add specific supported revision of D-Link DWA-140 rev B1, B2.

Submitted by: PseudoCylon
MFC after: 1 week

11 years agoFix my email.
glebius [Wed, 13 Feb 2013 07:32:09 +0000 (07:32 +0000)]
Fix my email.

11 years agoAdd myself as a ports committer and my mentor relationship.
pclin [Wed, 13 Feb 2013 05:44:35 +0000 (05:44 +0000)]
Add myself as a ports committer and my mentor relationship.

Approved by: swills (mentor)

11 years agoPull out the if_transmit() work and revert back to ath_start().
adrian [Wed, 13 Feb 2013 05:32:19 +0000 (05:32 +0000)]
Pull out the if_transmit() work and revert back to ath_start().

My changed had some rather significant behavioural changes to throughput.
The two issues I noticed:

* With if_start and the ifnet mbuf queue, any temporary latency
  would get eaten up by some mbufs being queued.  With ath_transmit()
  queuing things to ath_buf's, I'd only get 512 TX buffers before I
  couldn't queue any further frames.

* There's also some non-zero latency involved with TX being pushed
  into a taskqueue via direct dispatch.  Any time the scheduler didn't
  immediately schedule the ath TX task would cause extra latency.
  Various 1ge/10ge drivers implement both direct dispatch (if the TX
  lock can be acquired) and deferred task transmission (if the TX lock
  can't be acquired), with frames being pushed into a drbd queue.
  I'll have to do this at some point, but until I figure out how to
  deal with 802.11 fragments, I'll have to wait a while longer.

So what I saw:

* lots of extra latency, specially under load - if the taskqueue
  wasn't immediately scheduled, things went pear shaped;

* any extra latency would result in TX ath_buf's taking their sweet time
  being replenished, so any further calls to ath_transmit() would drop
  mbufs.

* .. yes, there's no explicit backpressure here - things are just dropped.
  Eek.

With this, the general performance has gone up, but those subtle if_start()
related race conditions are back.  For some reason, this is doubly-obvious
with the AR5416 NIC and I don't quite understand why yet.

There's an unrelated issue with AR5416 performance in STA mode (it's
fine in AP mode when bridging frames, weirdly..) that requires a little
further investigation.  Specifically - it works fine on a Lenovo T40
(single core CPU) running a March 2012 9-STABLE kernel, but a Lenovo T60
(dual core) running an early November 2012 kernel behaves very poorly.
The same hardware with an AR9160 or AR9280 behaves perfectly.

11 years agoIntroduce PLATFORMMETHOD_END and use it.
rpaulo [Wed, 13 Feb 2013 02:21:45 +0000 (02:21 +0000)]
Introduce PLATFORMMETHOD_END and use it.

11 years ago- Make actually printing path of AF_LOCAL socket types.
zont [Tue, 12 Feb 2013 19:10:54 +0000 (19:10 +0000)]
- Make actually printing path of AF_LOCAL socket types.

MFC after: 1 week

11 years ago- Use correct size of copying different socket structures.
zont [Tue, 12 Feb 2013 18:48:11 +0000 (18:48 +0000)]
- Use correct size of copying different socket structures.

MFC after: 1 week

11 years agoEliminate the PC_CURTHREAD symbol and load the current thread's
marcel [Tue, 12 Feb 2013 17:38:35 +0000 (17:38 +0000)]
Eliminate the PC_CURTHREAD symbol and load the current thread's
thread structure pointer atomically from r13 (the pcpu pointer)
for the current CPU/core.
Add a CTASSERT in machdep.c to make sure that pc_curthread is in
fact the first field in struct pcpu.

The only non-atomic operations left were those related to process-
space operations, such as casuword, subyte, suword16, fubyte,
fuword16, copyin, copyout and their variations.

The casuword function has been re-structured more complete than
the others. This way we have an example of a better bundling
without introducing a lot of risk when we get it wrong. The
other functions can be rebundled in separate commits and with
the appropriate testing.

11 years agoEliminate padding by moving 'narg' next to 'code'. Both are 32-bit
marcel [Tue, 12 Feb 2013 17:24:41 +0000 (17:24 +0000)]
Eliminate padding by moving 'narg' next to 'code'. Both are 32-bit
entities in the syscall_args structure that otherwise has 64-bit
only fields.

11 years agoReform the busdma API so that new types may be added without modifying
kib [Tue, 12 Feb 2013 16:57:20 +0000 (16:57 +0000)]
Reform the busdma API so that new types may be added without modifying
every architecture's busdma_machdep.c.  It is done by unifying the
bus_dmamap_load_buffer() routines so that they may be called from MI
code.  The MD busdma is then given a chance to do any final processing
in the complete() callback.

The cam changes unify the bus_dmamap_load* handling in cam drivers.

The arm and mips implementations are updated to track virtual
addresses for sync().  Previously this was done in a type specific
way.  Now it is done in a generic way by recording the list of
virtuals in the map.

Submitted by: jeff (sponsored by EMC/Isilon)
Reviewed by: kan (previous version), scottl,
mjacob (isp(4), no objections for target mode changes)
Discussed with:      ian (arm changes)
Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris),
amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>)

11 years agoNow that we actually use more memory descriptors, make sure to dump
marcel [Tue, 12 Feb 2013 16:51:43 +0000 (16:51 +0000)]
Now that we actually use more memory descriptors, make sure to dump
them as well.

11 years agoo Bring in sync decoding the first nfssvc(2) parameter (flags) with
pluknet [Tue, 12 Feb 2013 13:01:34 +0000 (13:01 +0000)]
o Bring in sync decoding the first nfssvc(2) parameter (flags) with
the current definitions location.
o Respect numbers in NFSSVC_* (e.g. NFSSVC_V4ROOTEXPORT).

MFC after: 1 week

11 years agoSubstitute '#ifdef ALIGNED_POINTER' with '#ifndef __NO_STRICT_ALIGNMENT',
glebius [Tue, 12 Feb 2013 11:24:37 +0000 (11:24 +0000)]
Substitute '#ifdef ALIGNED_POINTER' with '#ifndef __NO_STRICT_ALIGNMENT',
since the former is defined everywhere. This cuts off some code not
necessary on non strict aligment arches.

Reviewed by: adrian
Sponsored by: Nginx, Inc.

11 years agoRemove debug output
gonzo [Tue, 12 Feb 2013 07:27:40 +0000 (07:27 +0000)]
Remove debug output

11 years agoWhen clang builds libc it may insert calls to __aeabi_* functions. Normally
andrew [Tue, 12 Feb 2013 06:04:51 +0000 (06:04 +0000)]
When clang builds libc it may insert calls to __aeabi_* functions. Normally
this is not a problem as they are resolved by libgcc. The exception is for
the __aeabi_mem* functions. These call back into libc to the appropriate
function. This causes issues for static binaries as we only link against
libc once so there is no way for it to call into libgcc and back.

The fix for this is to include these symbols in libc but keep them hidden
so binaries use the libgcc version.

11 years agoAllow us to build clang for ARM EABI. Clang and llvm use the
andrew [Tue, 12 Feb 2013 05:56:00 +0000 (05:56 +0000)]
Allow us to build clang for ARM EABI. Clang and llvm use the
arm-gnueabi-freebsd10.0 triple for EABI. Use this when we are on arm or
armv6 and are building for EABI.

Reviewed by: dim

11 years agoStyle.
pjd [Mon, 11 Feb 2013 23:14:54 +0000 (23:14 +0000)]
Style.

11 years agoUpdate comments to reflect r246689.
marius [Mon, 11 Feb 2013 23:05:10 +0000 (23:05 +0000)]
Update comments to reflect r246689.

11 years agoStyle.
pjd [Mon, 11 Feb 2013 22:54:23 +0000 (22:54 +0000)]
Style.