]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoUse VMBASE in place of a hard-coded filename in the CLEANFILES list.
Glen Barber [Sun, 28 Sep 2014 01:53:02 +0000 (01:53 +0000)]
Use VMBASE in place of a hard-coded filename in the CLEANFILES list.

Sponsored by: The FreeBSD Foundation

9 years agoInitial commit to include virtual machine images as part
Glen Barber [Sun, 28 Sep 2014 01:45:20 +0000 (01:45 +0000)]
Initial commit to include virtual machine images as part
of the FreeBSD release builds.

This adds a make(1) environment variable requirement,
WITH_VMIMAGES, which triggers the virtual machine image
targets when not defined to an empty value.

Relevant user-driven variables include:

 o VMFORMATS: The virtual machine image formats to create.
   Valid formats are provided by running 'mkimg --formats'

 o VMSIZE: The size of the resulting virtual machine
   image.  Typical compression is roughly 140Mb, regardless
   of the target size (10GB, 15GB, 20GB, 40GB sizes have been
   tested with the same result).

 o VMBASE: The prefix of the virtual machine disk images.
   The VMBASE make(1) environment variable is suffixed with
   each format in VMFORMATS for each individual disk image, as
   well as '.img' for the source UFS filesystem passed to
   mkimg(1).

This also includes a new script, mk-vmimage.sh, based on how
the VM images for 10.0-RELEASE, 9.3-RELEASE, and 10.1-RELEASE
were created (mk-vmimage.sh in ^/user/gjb/thermite/).

With the order in which the stages need to occur, as well as
sanity-checking error cases, it makes much more sense to
execute a shell script called from make(1), using env(1) to
set specific parameters for the target image than it does to
do this in make(1) directly.

Sponsored by: The FreeBSD Foundation

9 years agoConvert driver to if_get_counter method.
Gleb Smirnoff [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().
Gleb Smirnoff [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().
Gleb Smirnoff [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.
Alexander Motin [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
Steven Hartland [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.
Navdeep Parhar [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 Moolenaar [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
Bjoern A. Zeeb [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
Alexander Kabaev [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.
Alexander Kabaev [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
Kevin Lo [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
Alexander V. Chernikov [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.
Sean Bruno [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 Turner [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.
Xin LI [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
Colin Percival [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.
Sean Bruno [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:
Alexander V. Chernikov [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.
Navdeep Parhar [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 Chadd [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 Moolenaar [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 Natu [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.
Kevin Lo [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.
Peter 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.
Navdeep Parhar [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.
Xin LI [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
Mateusz Guzik [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
Navdeep Parhar [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
John Baldwin [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 Lepore [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 Atkinson [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.
Gleb Smirnoff [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
Gleb Smirnoff [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
John-Mark Gurney [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.
Andrey V. Elsukov [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.
Gleb Smirnoff [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,
Allan Jude [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
Dag-Erling Smørgrav [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.
Christian 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.
Sergey Kandaurov [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().
Gleb Smirnoff [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.
Gleb Smirnoff [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 Atkinson [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.
Colin Percival [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 Atkinson [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.
Kevin Lo [Fri, 26 Sep 2014 09:08:09 +0000 (09:08 +0000)]
Fix the size of AT91SAM9260_PIT_SIZE.

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

9 years agoxen: add proper copyright attribution
Roger Pau Monné [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,
Gleb Smirnoff [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 Atkinson [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.
Gleb Smirnoff [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.
Gleb Smirnoff [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.
Mark Johnston [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.
Xin LI [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.
Sergey Kandaurov [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
Pedro F. Giffuni [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*.
Xin LI [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.
Xin LI [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.
Xin LI [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
Xin LI [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
Xin LI [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.
Xin LI [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
Xin LI [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.
Steve 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,
Warren Block [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
Allan Jude [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
Konstantin Belousov [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
Konstantin Belousov [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
John Baldwin [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.
Pedro F. Giffuni [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
Pedro F. Giffuni [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
Mark Johnston [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).
John Baldwin [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
John Baldwin [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
Pedro F. Giffuni [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:
John Baldwin [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
Ruslan Bukin [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 Rizzo [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 Rizzo [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 Lepore [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 Rizzo [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 Atkinson [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 Atkinson [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
Ed Maste [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 Atkinson [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.
Pawel Jakub Dawidek [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,
Gleb Smirnoff [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
Roger Pau Monné [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,
Gleb Smirnoff [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.

9 years ago- Provide lmc_get_counter() to return counters that are not collected,
Gleb Smirnoff [Thu, 25 Sep 2014 07:00:31 +0000 (07:00 +0000)]
- Provide lmc_get_counter() to return counters that are not collected,
  but taken from hardware.
- Mechanically convert to if_inc_counter() the rest of counters.

9 years agoRun through unifdef(1) with slight hand-editing after. It is obvious,
Gleb Smirnoff [Thu, 25 Sep 2014 06:47:38 +0000 (06:47 +0000)]
Run through unifdef(1) with slight hand-editing after. It is obvious,
that the driver is not going to be ever improved in terms of hardware
support, it is going to be only maintained as our kernel APIs change.
Carrying all the compatibility with ancient versions of NetBSD, OpenBSD,
Linux and BSDI, as well as obsoleted FreeBSD versions has no reason.

9 years agoWhitespace cleanup.
Gleb Smirnoff [Thu, 25 Sep 2014 05:47:33 +0000 (05:47 +0000)]
Whitespace cleanup.

9 years ago- Provide mxge_get_counter() to return counters that are not collected,
Gleb Smirnoff [Thu, 25 Sep 2014 05:45:52 +0000 (05:45 +0000)]
- Provide mxge_get_counter() to return counters that are not collected,
  but taken from hardware.
- Mechanically convert to if_inc_counter() the rest of counters.

9 years agoFix NULL pointer deref in ipfw when using dummynet at layer 2.
Sean Bruno [Thu, 25 Sep 2014 02:26:05 +0000 (02:26 +0000)]
Fix NULL pointer deref in ipfw when using dummynet at layer 2.
Drop packet if pkg->ifp is NULL, which is the case here.

ref. https://github.com/HardenedBSD/hardenedBSD
commit 4eef3881c64f6e3aa38eebbeaf27a947a5d47dd7

PR 193861 --  DUMMYNET LAYER2: kernel panic

in this case a kernel panic occurs. Hence, when we do not get an interface,
we just drop the packet in question.

PR: 193681
Submitted by: David Carlier <david.carlier@hardenedbsd.org>
Obtained from: Hardened BSD
MFC after: 2 weeks
Relnotes: yes

9 years agoAdd baseline files for QCOW2.
Marcel Moolenaar [Wed, 24 Sep 2014 22:58:10 +0000 (22:58 +0000)]
Add baseline files for QCOW2.

9 years agoIncrease the memory disk size in the following testcases to avoid mount
Enji Cooper [Wed, 24 Sep 2014 22:51:16 +0000 (22:51 +0000)]
Increase the memory disk size in the following testcases to avoid mount
failures, which would cause cascade failures in the rest of the test
run:

link/15.t, open/19.t, mkdir/11.t, mkfifo/11.t, symlink/11.t

Fail quickly in all of the testcases if mdconfig, mount, umount, etc
fails to avoid issues similar to this in the future

Submitted by: Casey Peel <cpeel@isilon.com>
MFC after: 2 weeks
X-MFC with: r272057
Sponsored by: EMC / Isilon Storage Division

9 years agoFinish QCOW version 2 and stop making it conditional.
Marcel Moolenaar [Wed, 24 Sep 2014 22:45:03 +0000 (22:45 +0000)]
Finish QCOW version 2 and stop making it conditional.

We have a different ordering for the RC block(s) and L2 tables.
This is expected to be a non-issue, because everything is found
through file offsets in the corresponding RC table and L1 table.
Files that grow organically have RC blocks and L2 tables scattered
all over the place anyway.

The reason for the difference is that mkimg needs to be able to
write to a pipe. We can't seek forward and backward to fill in
the bits in non-sequential order.

9 years agoAdd myself (jch) to calendar.freebsd and committers-src.dot
Julien Charbon [Wed, 24 Sep 2014 22:31:40 +0000 (22:31 +0000)]
Add myself (jch) to calendar.freebsd and committers-src.dot

Approved by: jhb (mentor)