]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years ago- Cleanups pc98 code.
nyan [Sun, 28 Sep 2014 11:32:46 +0000 (11:32 +0000)]
- Cleanups pc98 code.
- Remove unworked formats.

9 years agoDo not transfer unneeded training zero bytes in INQUIRY response.
mav [Sun, 28 Sep 2014 11:10:37 +0000 (11:10 +0000)]
Do not transfer unneeded training zero bytes in INQUIRY response.

It is an addition to r269631.

9 years agoRemove duplicate prog.
nyan [Sun, 28 Sep 2014 08:59:38 +0000 (08:59 +0000)]
Remove duplicate prog.

9 years agoFinally, convert counters in struct ifnet to counter(9).
glebius [Sun, 28 Sep 2014 08:57:07 +0000 (08:57 +0000)]
Finally, convert counters in struct ifnet to counter(9).

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoMerged from r183296.
nyan [Sun, 28 Sep 2014 08:23:26 +0000 (08:23 +0000)]
Merged from r183296.

  Add missing library dependencies.

9 years agoConvert to if_inc_counter() last remnantes of bare access to struct ifnet
glebius [Sun, 28 Sep 2014 07:43:38 +0000 (07:43 +0000)]
Convert to if_inc_counter() last remnantes of bare access to struct ifnet
counters.

9 years agoProvide ixgb_get_counter().
glebius [Sun, 28 Sep 2014 07:40:26 +0000 (07:40 +0000)]
Provide ixgb_get_counter().

9 years agoConvert to if_get_counter().
glebius [Sun, 28 Sep 2014 07:29:45 +0000 (07:29 +0000)]
Convert to if_get_counter().

9 years agoFix the AR724x PCIe glue to correctly probe the BAR on AR7240 devices.
adrian [Sun, 28 Sep 2014 07:27:58 +0000 (07:27 +0000)]
Fix the AR724x PCIe glue to correctly probe the BAR on AR7240 devices.

There's a bug in the AR7240 PCIe hardware where a correct BAR will end
up having the device disappear.

It turns out that for the device address it should be all 0's.

However, this meant that the PCI probe code would try writing 0xffffffff
in to see how big the window was, read back 0x0, and think the window
was 32 bits.  It then ended up calculating a resource size of 0 bytes,
failed to find anything via an rman call, and this would fail to attach.

I have quite absolutely no idea how in the various planes of existence
this particular bit of code and how it worked with the PCI bus code
ever worked.  But, well, it did.

Tested:

* Atheros AP93 - AR7240 + AR9280 reference board

9 years agoMechanically switch ixv(4) to if_inc_counter().
glebius [Sun, 28 Sep 2014 07:19:32 +0000 (07:19 +0000)]
Mechanically switch ixv(4) to if_inc_counter().

9 years agoFix the ar724x PCI config space register read.
adrian [Sun, 28 Sep 2014 05:28:11 +0000 (05:28 +0000)]
Fix the ar724x PCI config space register read.

It was doing incorrect things with masks.  This was fixed in the
AR71xx codebase but it wasn't yet fixed in the AR724x code.

This ended up having config space reads return larger/incorrect values
in some situations.

Tested:

* AR7240

TODO:

* test ar7241, AR7242, and AR934x.

9 years agoConvert driver to if_get_counter method.
glebius [Sat, 27 Sep 2014 20:54:57 +0000 (20:54 +0000)]
Convert driver to if_get_counter method.

Submitted by: rstone
Reviewed by: Eric Joyner <ricera10 gmail.com>

9 years agoMechanically convert to if_inc_counter().
glebius [Sat, 27 Sep 2014 20:43:01 +0000 (20:43 +0000)]
Mechanically convert to if_inc_counter().

9 years agoMechanically convert to if_inc_counter().
glebius [Sat, 27 Sep 2014 20:39:24 +0000 (20:39 +0000)]
Mechanically convert to if_inc_counter().

9 years agoFix page length reported for Block Limits VPD page.
mav [Sat, 27 Sep 2014 20:08:34 +0000 (20:08 +0000)]
Fix page length reported for Block Limits VPD page.

9 years agoUse a local STAILQ for unlocked done CCB processing in ahci direct mode
smh [Sat, 27 Sep 2014 19:14:22 +0000 (19:14 +0000)]
Use a local STAILQ for unlocked done CCB processing in ahci direct mode

Previously it was possible for issues e.g. use after free, to result
from processing the done queue while not holding the channel lock.

While this should never happen in practice, unexpected code flows
which result in two threads processing from the same queue may
be possible.

We now use a local STAILQ to prevent this ever being an issue.

Sponsored by: Multiplay

9 years agocxgb(4): implement if_get_counter.
np [Sat, 27 Sep 2014 18:35:16 +0000 (18:35 +0000)]
cxgb(4): implement if_get_counter.

9 years agoUpdate the usage message and the man page to account for the new long
marcel [Sat, 27 Sep 2014 17:58:03 +0000 (17:58 +0000)]
Update the usage message and the man page to account for the new long
options. Bump the version number to 20140927.
While here, use explicit fputc() calls to skip a line in the output.
This to avoid having to hunt for extra '\n' characters in the printf
format strings.

MFC after: 1 week
Relnotes: yes

9 years agoDisable the makeoption with MFS_IMAGE= set as we don't ship that file
bz [Sat, 27 Sep 2014 17:11:51 +0000 (17:11 +0000)]
Disable the makeoption with MFS_IMAGE= set as we don't ship that file
and it thus breaks the default build.   You can still use various other
ways (tools) to embedd the image after the kernel build.

9 years agoDo not pass whole descriptor block size as align to fwdma_malloc_multiseg
kan [Sat, 27 Sep 2014 16:50:24 +0000 (16:50 +0000)]
Do not pass whole descriptor block size as align to fwdma_malloc_multiseg

Do not pass wrong alignment value to fwdma_malloc_multiseg and ultimately
to contigalloc. In addition to being wrong, this causes insta-panic in
certain cases due to safety assertion - the alignment is required to be
the power of two and the value we calculate here seldom is.

MFC after:  1 month

9 years agoRemove obsolete compatibility glue and improve firewire code readability.
kan [Sat, 27 Sep 2014 16:50:21 +0000 (16:50 +0000)]
Remove obsolete compatibility glue and improve firewire code readability.

Commit my version of style(9) pass over the firewire code. Now that
other people have started changing the code carrying this is as a
local patch is not longer a viable option.

MFC after: 1 month

9 years agoFix the definitioin of AT91SAM9G45_IRQ_PIOE and rename it to
kevlo [Sat, 27 Sep 2014 14:39:00 +0000 (14:39 +0000)]
Fix the definitioin of AT91SAM9G45_IRQ_PIOE and rename it to
AT91SAM9G45_IRQ_PIODE.  According to the data sheet, both PIOD and PIOE
use the same IRQ.

While here remove duplicate definitions.

9 years agoUse underlying ports counters to get lagg statistics instead of
melifaro [Sat, 27 Sep 2014 13:57:48 +0000 (13:57 +0000)]
Use underlying ports counters to get lagg statistics instead of
per-packet accounting.
This introduce user-visible changes like aggregating error counters.

Reviewed by: asomers (prev.version), glebius
CR: D781
MFC after: 2 weeks
Sponsored by: Yandex LLC

9 years agoUpdate factor for changes to types in primes, which is a dependency.
sbruno [Sat, 27 Sep 2014 10:57:34 +0000 (10:57 +0000)]
Update factor for changes to types in primes, which is a dependency.

Fixes build-fail on mips32 introduced at 272207.

9 years agoAdd machine/sysreg.h to simplify accessing the system control coprocessor
andrew [Sat, 27 Sep 2014 09:57:34 +0000 (09:57 +0000)]
Add machine/sysreg.h to simplify accessing the system control coprocessor
registers and use it in the ARMv7 CPU functions.

The sysreg.h file has been checked by hand, however it may contain errors
with the comments on when a register was first introduced. The ARMv7 cpu
functions have been checked by compiling both the previous and this version
and comparing the md5 of the object files.

Submitted by: Svatopluk Kraus <onwahe at gmail.com>
Submitted by: Michal Meloun <meloun at miracle.cz>
Reviewed by: ian, rpaulo
Differential Revision: https://reviews.freebsd.org/D795

9 years agoRevert r272189, the committed version was an old version and breaks build.
delphij [Sat, 27 Sep 2014 09:39:19 +0000 (09:39 +0000)]
Revert r272189, the committed version was an old version and breaks build.

Pointy hat to: delphij

9 years agoSwitch primes(6) from using unsigned long to using uint64_t. This fixes
cperciva [Sat, 27 Sep 2014 09:00:38 +0000 (09:00 +0000)]
Switch primes(6) from using unsigned long to using uint64_t.  This fixes
'limited range of type' warnings about comparisons on 32-bit systems, and
allows 32-bit systems to compute the full range of primes.

9 years agoAdd kernel support for the TP-LINK MR3020 Atheros MIPS 24k router.
sbruno [Sat, 27 Sep 2014 08:59:43 +0000 (08:59 +0000)]
Add kernel support for the TP-LINK MR3020 Atheros MIPS 24k router.

AR9331 based system.

Phabric: https://reviews.freebsd.org/D780
Reviewed by: adrian

9 years ago* Split tcp_signature_compute() into 2 pieces:
melifaro [Sat, 27 Sep 2014 07:04:12 +0000 (07:04 +0000)]
* Split tcp_signature_compute() into 2 pieces:
 - tcp_get_sav() - SADB key lookup
 - tcp_signature_do_compute() - actual computation
* Fix TCP signature case for listening socket:
  do not assume EVERY connection coming to socket
  with TCP_SIGNATURE set to be md5 signed regardless
  of SADB key existance for particular address. This
  fixes the case for routing software having _some_
  BGP sessions secured by md5.
* Simplify TCP_SIGNATURE handling in tcp_input()

MFC after: 2 weeks

9 years agocxgbe(4): implement if_get_counter.
np [Sat, 27 Sep 2014 05:50:31 +0000 (05:50 +0000)]
cxgbe(4): implement if_get_counter.

9 years agoRemove an un-needed bit of pre-processor work - it all lives inside
adrian [Sat, 27 Sep 2014 05:14:02 +0000 (05:14 +0000)]
Remove an un-needed bit of pre-processor work - it all lives inside
#ifdef RSS.

9 years agoAdd 3 long options for getting information about mkimg itself:
marcel [Sat, 27 Sep 2014 04:53:51 +0000 (04:53 +0000)]
Add 3 long options for getting information about mkimg itself:
--version print the version of mkimg and also whether it's
64- or 32-bit.
--formats list the supported output formats separated by space.
--schemes list the supported partitioning schemes separated by
space.

Inspired by a patch from: gjb@

MFC after: 1 week
Relnotes: yes

9 years agoAfter r271635 mmap(2) requires either MAP_PRIVATE or MAP_SHARED
neel [Sat, 27 Sep 2014 03:43:49 +0000 (03:43 +0000)]
After r271635 mmap(2) requires either MAP_PRIVATE or MAP_SHARED
for non-anonymous mappings.

This gets 'bhyvectl --get-all' working again.

Reported by: Anish Gupta (akgupt3@gmail.com)

9 years agoRemove a bogus AIC.
kevlo [Sat, 27 Sep 2014 02:15:45 +0000 (02:15 +0000)]
Remove a bogus AIC.

Reviewed by: imp

9 years agoAllow the PIC's IMR register to be read before ICW initialisation.
grehan [Sat, 27 Sep 2014 01:15:24 +0000 (01:15 +0000)]
Allow the PIC's IMR register to be read before ICW initialisation.

As of git submit e179f6914152eca9, the Linux kernel does a simple
probe of the PIC by writing a pattern to the IMR and then reading it
back, prior to the init sequence of ICW words.

The bhyve PIC emulation wasn't allowing the IMR to be read until
the ICW sequence was complete. This limitation isn't required so
relax the test.

With this change, Linux kernels 3.15-rc2 and later won't hang
on boot when calibrating the local APIC.

Reviewed by: tychon
MFC after: 3 days

9 years agocxgbe(4): explicitly set various if_hw_tso* values.
np [Fri, 26 Sep 2014 22:21:02 +0000 (22:21 +0000)]
cxgbe(4): explicitly set various if_hw_tso* values.

MFC after: 3 days

9 years agoAdd libuutil to dependency list.
delphij [Fri, 26 Sep 2014 21:46:32 +0000 (21:46 +0000)]
Add libuutil to dependency list.

Noticed by: sef
MFC after: 3 days

9 years agoMake do_dup() static and move relevant macros to kern_descrip.c
mjg [Fri, 26 Sep 2014 19:48:47 +0000 (19:48 +0000)]
Make do_dup() static and move relevant macros to kern_descrip.c

No functional changes.

9 years agoMake sure the adapter's management queue and the event queue are
np [Fri, 26 Sep 2014 18:53:00 +0000 (18:53 +0000)]
Make sure the adapter's management queue and the event queue are
available before any uppper layer driver (TOE, iWARP, or iSCSI)
registers with the base cxgbe(4) driver.

Submitted by: Hariprasad at chelsio dot com
Reviewed by: np@

9 years agoDon't panic if a resource is allocated twice. Instead, print a warning and
jhb [Fri, 26 Sep 2014 18:37:49 +0000 (18:37 +0000)]
Don't panic if a resource is allocated twice.  Instead, print a warning and
fail the allocation request.  Allocations of "reserved" resources such as
PCI BARs already fail the request instead of panic'ing in this case.

MFC after: 1 week

9 years agoFix a paste-o commited in r272109: we need to get the interrupts for the
ian [Fri, 26 Sep 2014 15:16:53 +0000 (15:16 +0000)]
Fix a paste-o commited in r272109: we need to get the interrupts for the
child node, not the parent node.

Pointed out by: jhibbits@

9 years agoAdd ipheth(4) to the hardware notes.
gavin [Fri, 26 Sep 2014 13:12:00 +0000 (13:12 +0000)]
Add ipheth(4) to the hardware notes.

MFC after: 6 days

9 years agoRemove macros that hide access to struct ifnet fields.
glebius [Fri, 26 Sep 2014 13:02:29 +0000 (13:02 +0000)]
Remove macros that hide access to struct ifnet fields.

9 years agoMake all lagg protocol methods live in lagg_protos, not in softc. All
glebius [Fri, 26 Sep 2014 12:54:24 +0000 (12:54 +0000)]
Make all lagg protocol methods live in lagg_protos, not in softc. All
interfaces of a same protocol, use the same methods.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agodrop unnecessary ifdef IPSEC's. This file is only compiled when IPSEC
jmg [Fri, 26 Sep 2014 12:48:54 +0000 (12:48 +0000)]
drop unnecessary ifdef IPSEC's.  This file is only compiled when IPSEC
is defined...

Differential Revision: D839
Reviewed by: bz, glebius, gnn
Sponsered by: EuroBSDCon DevSummit

9 years agoKeep list of lagg ports sorted by if_index.
ae [Fri, 26 Sep 2014 12:42:06 +0000 (12:42 +0000)]
Keep list of lagg ports sorted by if_index.

Obtained from: Yandex LLC
MFC after: 1 week
Sponsored by: Yandex LLC

9 years ago- Whitespace.
glebius [Fri, 26 Sep 2014 12:35:58 +0000 (12:35 +0000)]
- Whitespace.
- Remove caddr_t.

9 years agoReplace the macros used in the previous man(1) commit with literal text,
allanjude [Fri, 26 Sep 2014 11:48:29 +0000 (11:48 +0000)]
Replace the macros used in the previous man(1) commit with literal text,
because the macros seem to be specific to groff, and do not render in
mandoc

Approved by: bcr (mentor)
Sponsored by: ScaleEngine Inc.

9 years agoAdd a line to the post-installation configuration dialog to enable the
des [Fri, 26 Sep 2014 11:38:10 +0000 (11:38 +0000)]
Add a line to the post-installation configuration dialog to enable the
local_unbound service.

MFC after: 3 days

9 years agoAdd smsc(4) to the hardware notes.
brueffer [Fri, 26 Sep 2014 11:22:32 +0000 (11:22 +0000)]
Add smsc(4) to the hardware notes.

9 years agoAdd smsc(4) to the list of drivers use the miibus interface.
pluknet [Fri, 26 Sep 2014 11:13:19 +0000 (11:13 +0000)]
Add smsc(4) to the list of drivers use the miibus interface.

X-MFC with: r272165
Sponsored by: Nginx, Inc.

9 years ago- Provide lagg_proto_attach(), lagg_proto_detach().
glebius [Fri, 26 Sep 2014 11:01:04 +0000 (11:01 +0000)]
- Provide lagg_proto_attach(), lagg_proto_detach().
- Make detach a protocol method in lagg_protos.
- Simplify code to lookup protocols.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years ago- Mechanically convert to if_inc_counter() the rest of counters.
glebius [Fri, 26 Sep 2014 10:47:57 +0000 (10:47 +0000)]
- Mechanically convert to if_inc_counter() the rest of counters.
- Do not set if_collisions on interrupt, read them in ti_get_counter().
- Add missing bus_dmamap_sync(BUS_DMASYNC_PREREAD) in ti_ioctl2(). [1]

Submitted by: mav [1]

9 years agoAdd MLINKS for if_ipheth(4) and if_smsc(4).
gavin [Fri, 26 Sep 2014 09:54:57 +0000 (09:54 +0000)]
Add MLINKS for if_ipheth(4) and if_smsc(4).

Submitted by: brueffer
MFC after: 6 days

9 years agoCorrectly enumerate primes between 4295098369 and 3825123056546413050.
cperciva [Fri, 26 Sep 2014 09:40:48 +0000 (09:40 +0000)]
Correctly enumerate primes between 4295098369 and 3825123056546413050.

Prior to this commit, primes(6) relied solely on sieving with primes up
to 65537, with the effect that composite numbers which are the product
of two non-16-bit primes would be incorrectly identified as prime.  For
example,
# primes 1099511627800 1099511627820
would output
1099511627803
1099511627807
1099511627813
when in fact only the first of those values is prime.

This commit adds strong pseudoprime tests to validate the candidates
which pass the initial sieving stage, using bases of 2, 3, 5, 7, 11,
13, 17, 19, and 23.  Thanks to papers from C. Pomerance, J.L. Selfridge,
and S.S. Wagstaff, Jr.; G. Jaeschke; and Y. Jiang and Y. Deng, we know
that the smallest value which passes these tests is 3825123056546413051.

At present we do not know how many strong pseudoprime tests are required
to prove primality for values larger than 3825123056546413050, so we
force primes(6) to stop at that point.

Reviewed by: jmg
Relnotes: primes(6) now correctly enumerates primes up to
3825123056546413050
MFC after: 7 days
Sponsored by: EuroBSDCon devsummit

9 years agoAdd very basic outline man page for smsc(4).
gavin [Fri, 26 Sep 2014 09:19:11 +0000 (09:19 +0000)]
Add very basic outline man page for smsc(4).

MFC after: 6 days

9 years agoFix the size of AT91SAM9260_PIT_SIZE.
kevlo [Fri, 26 Sep 2014 09:08:09 +0000 (09:08 +0000)]
Fix the size of AT91SAM9260_PIT_SIZE.

9 years agoFix typos.
kevlo [Fri, 26 Sep 2014 09:07:02 +0000 (09:07 +0000)]
Fix typos.

9 years agoxen: add proper copyright attribution
royger [Fri, 26 Sep 2014 09:05:55 +0000 (09:05 +0000)]
xen: add proper copyright attribution

Noted by: jmallett

9 years ago- When reconfiguring protocol on a lagg, first set it to LAGG_PROTO_NONE,
glebius [Fri, 26 Sep 2014 08:42:32 +0000 (08:42 +0000)]
- When reconfiguring protocol on a lagg, first set it to LAGG_PROTO_NONE,
  then drop lock, run the attach routines, and then set it to specific
  proto. This removes tons of WITNESS warnings.
- Make lagg protocol attach handlers not failing and allocate memory
  with M_WAITOK.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoAdd new (untested) device IDs to smsc(4)
gavin [Fri, 26 Sep 2014 08:16:26 +0000 (08:16 +0000)]
Add new (untested) device IDs to smsc(4)

MFC after: 1 week

9 years agoMake lagg protos a enum.
glebius [Fri, 26 Sep 2014 08:12:12 +0000 (08:12 +0000)]
Make lagg protos a enum.

9 years agoMake lagg protocols detach methods returning void.
glebius [Fri, 26 Sep 2014 07:12:40 +0000 (07:12 +0000)]
Make lagg protocols detach methods returning void.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoFix the description of the -h option.
markj [Fri, 26 Sep 2014 07:01:27 +0000 (07:01 +0000)]
Fix the description of the -h option.

Reported by: swills
MFC after: 3 days

9 years agoRefactor the code a little bit to reduce duplicated code.
delphij [Fri, 26 Sep 2014 05:05:34 +0000 (05:05 +0000)]
Refactor the code a little bit to reduce duplicated code.

Reviewed by: mjg
MFC after: 2 weeks

9 years agoFix description of mutex acquisition.
pluknet [Fri, 26 Sep 2014 04:33:27 +0000 (04:33 +0000)]
Fix description of mutex acquisition.

Reviewed by: kib
X-MFC with: r272070
Sponsored by: Nginx, Inc.

9 years agoRevert r272122
pfg [Thu, 25 Sep 2014 23:04:37 +0000 (23:04 +0000)]
Revert r272122

The patch still needs to be more robust and it broke the
build on MIPS so revert it for now while all the issues
are fixed.

Reported by: ache, davide
PR: 137307

9 years agoExplicitly set errno to 0 before calling strto*.
delphij [Thu, 25 Sep 2014 22:47:19 +0000 (22:47 +0000)]
Explicitly set errno to 0 before calling strto*.

Suggested by: mjg
MFC after: 2 weeks

9 years agoThe strtol(3) family of functions would set errno when it hits one.
delphij [Thu, 25 Sep 2014 22:37:27 +0000 (22:37 +0000)]
The strtol(3) family of functions would set errno when it hits one.
Check errno and handle it as invalid input.

Obtained from: HardenedBSD
Submitted by: David CARLIER <devnexen@gmail.com>
MFC after: 2 weeks

9 years agoUse a char * as iterator over a bounded string.
delphij [Thu, 25 Sep 2014 22:22:57 +0000 (22:22 +0000)]
Use a char * as iterator over a bounded string.

MFC after: 1 week

9 years agoUse strlcpy(). I don't believe these are real problems but it's better
delphij [Thu, 25 Sep 2014 22:22:54 +0000 (22:22 +0000)]
Use strlcpy(). I don't believe these are real problems but it's better
to use a safe idiom.

Reported by: Coverity
CID: 1238914
MFC after: 1 week

9 years agoRefactor the code a little bit to avoid NULL deference when
delphij [Thu, 25 Sep 2014 22:22:51 +0000 (22:22 +0000)]
Refactor the code a little bit to avoid NULL deference when
allocation was failed.

Reported by: Coverity
CID: 1238915
MFC after: 1 week

9 years agoPlug a file descriptor leak.
delphij [Thu, 25 Sep 2014 22:22:48 +0000 (22:22 +0000)]
Plug a file descriptor leak.

Reported by: Coverity
CID: 1238916
MFC after: 1 week

9 years agoBeing able to access a path do not necessarily mean we have access
delphij [Thu, 25 Sep 2014 22:22:43 +0000 (22:22 +0000)]
Being able to access a path do not necessarily mean we have access
to a directory. So instead of doing this, we just call mkdir(2)
directly and test if the returned value is 0 or errno is EISDIR.

Reported by: Coverity
CID: 1238925
MFC after: 1 week

9 years ago* Whitespace.
kargl [Thu, 25 Sep 2014 22:15:10 +0000 (22:15 +0000)]
* Whitespace.

9 years agoRevised to better point to release notes and errata, security advisories,
wblock [Thu, 25 Sep 2014 21:57:35 +0000 (21:57 +0000)]
Revised to better point to release notes and errata, security advisories,
and be more specific about the -questions list.

MFC after: 3 days

9 years agoUpdate man(1) to list the different sections of the manual
allanjude [Thu, 25 Sep 2014 21:34:57 +0000 (21:34 +0000)]
Update man(1) to list the different sections of the manual

Add each of the intro sections to the 'Also See' list

PR: 193460
Differential Revision: D834
Approved by: bcr (mentor)
Sponsored by: ScaleEngine Inc.

9 years agoFix fcntl(2) compat32 after r270691. The copyin and copyout of the
kib [Thu, 25 Sep 2014 21:07:19 +0000 (21:07 +0000)]
Fix fcntl(2) compat32 after r270691.  The copyin and copyout of the
struct flock are done in the sys_fcntl(), which mean that compat32 used
direct access to userland pointers.

Move code from sys_fcntl() to new wrapper, kern_fcntl_freebsd(), which
performs neccessary userland memory accesses, and use it from both
native and compat32 fcntl syscalls.

Reported by: jhibbits
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

9 years agoIn kern_linkat() and kern_renameat(), do not call namei(9) while
kib [Thu, 25 Sep 2014 20:42:25 +0000 (20:42 +0000)]
In kern_linkat() and kern_renameat(), do not call namei(9) while
holding a write reference on the filesystem.  Try to get write
reference in unblocked way after all vnodes are resolved; if failed,
drop all locks and retry after waiting for suspension end.

The VFS_UNMOUNT() methods for UFS and tmpfs try to establish
suspension on unmount, while covered vnode is locked by VFS, which
prevents namei() from stepping over the mount point.  The thread doing
namei() sleeps on the covered vnode lock, owning the write ref.

Reported by: bdrewery
Tested by: bdrewery (previous version), pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoMerge the PC98 fdc(4) driver into the MI driver. While here, replace
jhb [Thu, 25 Sep 2014 20:40:24 +0000 (20:40 +0000)]
Merge the PC98 fdc(4) driver into the MI driver.  While here, replace
the magic numbers used with NE7CMD_SPECIFY with invocations of the
NE7_SPEC_x() macros.

Approved by: nyan

9 years agobsdgrep: Work-around for segmentation fault.
pfg [Thu, 25 Sep 2014 19:22:26 +0000 (19:22 +0000)]
bsdgrep: Work-around for segmentation fault.

Fix by David Carlier.

Obtained from: HardenedBSD
PR: 167921
MFC after: 1 month

9 years agoreiserfs: Use signed i_nlink
pfg [Thu, 25 Sep 2014 19:10:32 +0000 (19:10 +0000)]
reiserfs: Use signed i_nlink

Unlike Linux, FreeBSD's kernel doesn't like unsigned file link
count. This is consistent with our ext2fs implementation.

MFC after: 1 month

9 years agoFactor out some of the duplicated code in the symbol lookup functions, in
markj [Thu, 25 Sep 2014 19:08:06 +0000 (19:08 +0000)]
Factor out some of the duplicated code in the symbol lookup functions, in
preparation for adding userland CTF support to DTrace.

MFC after: 1 month
Sponsored by: EMC / Isilon Storage Division

9 years agoUse callout(9) instead of timeout(9).
jhb [Thu, 25 Sep 2014 18:54:36 +0000 (18:54 +0000)]
Use callout(9) instead of timeout(9).

Approved by: nyan

9 years agoUse callout() instead of timeout(). This is almost identical to the
jhb [Thu, 25 Sep 2014 18:53:27 +0000 (18:53 +0000)]
Use callout() instead of timeout().  This is almost identical to the
changes in r271963.

Approved by: nyan

9 years agoAdd strptime(3) support for %U and %W
pfg [Thu, 25 Sep 2014 18:52:17 +0000 (18:52 +0000)]
Add strptime(3) support for %U and %W

Add support for the missing POSIX-2001 %U and %W features: the
existing  FreeBSD strptime code recognizes both directives and
validates that the week number lies in the permitted range,
but then simply discards the value.

Initial support for the feature was written by Paul Green with
important fixes by Andrey Chernov. Additional support for
handling tm_wday/tm_yday was written by David Carlier.

PR: 137307
MFC after: 1 month

9 years agoLock ncr(4) and mark it MPSAFE along with various other fixes:
jhb [Thu, 25 Sep 2014 18:43:52 +0000 (18:43 +0000)]
Lock ncr(4) and mark it MPSAFE along with various other fixes:
- Use bus_*() instead of bus_space_*().
- Use device_printf().
- Remove unused global variables and the extra warning suppression
  they required.
- Use callout() instead of timeout().

Reviewed by: se

9 years agoAdd driver for Synopsys DesignWare 3504-0 Universal 10/100/1000
br [Thu, 25 Sep 2014 18:03:14 +0000 (18:03 +0000)]
Add driver for Synopsys DesignWare 3504-0 Universal 10/100/1000
Ethernet MAC.

Sponsored by: DARPA, AFRL

9 years agofix a panic when passing ifioctl from a netmap file descriptor to
luigi [Thu, 25 Sep 2014 16:22:32 +0000 (16:22 +0000)]
fix a panic when passing ifioctl from a netmap file descriptor to
the underlying device. This needs to be merged to 10.1

Reported by: Patrick Kelsey
MFC after: 3 days

9 years agoadapt the code to different freebsd versions.
luigi [Thu, 25 Sep 2014 15:57:57 +0000 (15:57 +0000)]
adapt the code to different freebsd versions.
Not necessary to MFC

9 years agoReplace multiple nearly-identical copies of code to walk through an FDT
ian [Thu, 25 Sep 2014 15:02:33 +0000 (15:02 +0000)]
Replace multiple nearly-identical copies of code to walk through an FDT
node's interrupts=<...> property creating resource list entries with a
single common implementation.  This change makes ofw_bus_intr_to_rl() the
one true copy of that code and removes the copies of it from other places.

This also adds handling of the interrupts-extended property, which allows
specifying multiple interrupts for a node where each interrupt can have a
separate interrupt-parent.  The bindings for this state that the property
cells contain an xref phandle to the interrupt parent followed by whatever
interrupt info that parent normally expects.  This leads to having a
variable number of icells per interrupt in the property.  For example you
could have <&intc1 1 &intc2 26 9 0 &intc3 9 4>.

Differential Revision: https://reviews.freebsd.org/D803

9 years agoadd missing file
luigi [Thu, 25 Sep 2014 14:25:38 +0000 (14:25 +0000)]
add missing file

Submitted by: Daniel Peyrolon
MFC after: 3 days

9 years agoCross reference cdce(4), ipheth(4) and urndis(4) from each other.
gavin [Thu, 25 Sep 2014 14:22:32 +0000 (14:22 +0000)]
Cross reference cdce(4), ipheth(4) and urndis(4) from each other.

MFC after: 1 week

9 years agoAdd basic man page for ipheth(4).
gavin [Thu, 25 Sep 2014 14:18:34 +0000 (14:18 +0000)]
Add basic man page for ipheth(4).

MFC after: 1 week

9 years agoRemove duplicated header content
emaste [Thu, 25 Sep 2014 13:31:08 +0000 (13:31 +0000)]
Remove duplicated header content

I fail at patch(1).

MFC after: 3 days

9 years agoMove the ARM Samsung s3c2xx0 support files into the samsung directory, to
gavin [Thu, 25 Sep 2014 11:38:26 +0000 (11:38 +0000)]
Move the ARM Samsung s3c2xx0 support files into the samsung directory, to
match other platforms.

Discussed with: andrew

9 years agoDocument the new nvlist_get_parent() function.
pjd [Thu, 25 Sep 2014 10:59:01 +0000 (10:59 +0000)]
Document the new nvlist_get_parent() function.

Submitted by: Mariusz Zaborski

9 years agoProvide vmxnet3_get_counter() to return counters that are not collected,
glebius [Thu, 25 Sep 2014 08:36:11 +0000 (08:36 +0000)]
Provide vmxnet3_get_counter() to return counters that are not collected,
but taken from hardware.

9 years agoddb: allow specifying the exact address of the symtab and strtab
royger [Thu, 25 Sep 2014 08:28:10 +0000 (08:28 +0000)]
ddb: allow specifying the exact address of the symtab and strtab

When the FreeBSD kernel is loaded from Xen the symtab and strtab are
not loaded the same way as the native boot loader. This patch adds
three new global variables to ddb that can be used to specify the
exact position and size of those tables, so they can be directly used
as parameters to db_add_symbol_table. A new helper is introduced, so callers
that used to set ksym_start and ksym_end can use this helper to set the new
variables.

It also adds support for loading them from the Xen PVH port, that was
previously missing those tables.

Sponsored by: Citrix Systems R&D
Reviewed by: kib

ddb/db_main.c:
 - Add three new global variables: ksymtab, kstrtab, ksymtab_size that
   can be used to specify the position and size of the symtab and
   strtab.
 - Use those new variables in db_init in order to call db_add_symbol_table.
 - Move the logic in db_init to db_fetch_symtab in order to set ksymtab,
   kstrtab, ksymtab_size from ksym_start and ksym_end.

ddb/ddb.h:
 - Add prototype for db_fetch_ksymtab.
 - Declate the extern variables ksymtab, kstrtab and ksymtab_size.

x86/xen/pv.c:
 - Add support for finding the symtab and strtab when booted as a Xen
   PVH guest. Since Xen loads the symtab and strtab as NetBSD expects
   to find them we have to adapt and use the same method.

amd64/amd64/machdep.c:
arm/arm/machdep.c:
i386/i386/machdep.c:
mips/mips/machdep.c:
pc98/pc98/machdep.c:
powerpc/aim/machdep.c:
powerpc/booke/machdep.c:
sparc64/sparc64/machdep.c:
 - Use the newly introduced db_fetch_ksymtab in order to set ksymtab,
   kstrtab and ksymtab_size.

9 years ago- Provide bce_get_counter() to return counters that are not collected,
glebius [Thu, 25 Sep 2014 07:22:24 +0000 (07:22 +0000)]
- Provide bce_get_counter() to return counters that are not collected,
  but taken from hardware.
- Mechanically convert to if_inc_counter() the rest of counters.
- While here fix 3 instances of the same bug, when error counter was ++
  in one place and then assigned in other place, losing the increment.
  Achieve that storing soft errors counters in softc.