]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoRemove useless NULL string '' in compound strings. Look very closely.
dteske [Fri, 14 Mar 2014 02:56:49 +0000 (02:56 +0000)]
Remove useless NULL string '' in compound strings. Look very closely.

10 years agoSet nokeyword property on some files which don't already have it. This will allow...
eadler [Fri, 14 Mar 2014 02:53:36 +0000 (02:53 +0000)]
Set nokeyword property on some files which don't already have it.  This will allow my next commit.

10 years agoFix future namespace issues for functions taking $var_to_set -- functions
dteske [Fri, 14 Mar 2014 02:50:32 +0000 (02:50 +0000)]
Fix future namespace issues for functions taking $var_to_set -- functions
taking a variable to set need to make sure they protect their locals; if
$var_to_set positional argument coincides with a local the expected call
to `setvar' will fail to reach outside of the function's namespace. When
such collisions are experienced (as I did in the rewrite of usermgmt) the
solution is to append a full or abbreviated version of the function name
to the local (ultimately eliminating collisions). This is rarely needed
and only occurs when you have a lot of like-named functions that pass
very similar $var_to_set positional arguments to each other (such as-is
the case with an expansive library such as `dialog.subr').

10 years agoUpdate copyright.
dteske [Fri, 14 Mar 2014 02:40:52 +0000 (02:40 +0000)]
Update copyright.

10 years agoComments.
dteske [Fri, 14 Mar 2014 02:39:42 +0000 (02:39 +0000)]
Comments.

10 years agoAdd debug statement just before attempting to exec a module.
dteske [Fri, 14 Mar 2014 02:38:56 +0000 (02:38 +0000)]
Add debug statement just before attempting to exec a module.

10 years agoRemove indexfile from debug statement as it is already logged by
dteske [Fri, 14 Mar 2014 02:37:39 +0000 (02:37 +0000)]
Remove indexfile from debug statement as it is already logged by
f_index_menusel_command() used just-prior to this debug statement.
Also, log the arguments being passed to the resword.

10 years agoCleanup redundant logic and add some comments to help explain how
bdrewery [Fri, 14 Mar 2014 02:10:30 +0000 (02:10 +0000)]
Cleanup redundant logic and add some comments to help explain how
it works in lieu of potentially less clear code.

Sponsored by: EMC / Isilon Storage Division
Discussed with: Russell Cattelan

10 years agoFix -o size less than PAGE_SIZE resulting in SIZE_MAX being used.
bdrewery [Fri, 14 Mar 2014 01:43:55 +0000 (01:43 +0000)]
Fix -o size less than PAGE_SIZE resulting in SIZE_MAX being used.

Discussed with: kib
MFC after: 2 weeks

10 years agoCombine similar code from vprintf(9) and log(9).
bdrewery [Fri, 14 Mar 2014 01:17:11 +0000 (01:17 +0000)]
Combine similar code from vprintf(9) and log(9).

MFC after: 2 weeks

10 years agoFix an uninitialized variable error I perpetrated when splitting some
ian [Fri, 14 Mar 2014 00:49:02 +0000 (00:49 +0000)]
Fix an uninitialized variable error I perpetrated when splitting some
code into a separate function.  Pass the missing value from main() to
the probe_disks() function.

10 years agoHide a few messages under bootverbose.
delphij [Fri, 14 Mar 2014 00:47:46 +0000 (00:47 +0000)]
Hide a few messages under bootverbose.

Reviewed by: Abhishek Gupta
MFC after: 2 weeks

10 years agoRe-format the license to conform to our BSD license template as much
brueffer [Thu, 13 Mar 2014 23:31:05 +0000 (23:31 +0000)]
Re-format the license to conform to our BSD license template as much
as possible.  This does not change the wording in any way.

Remove the 3rd clause ("advertising clause") of the BSD license as
permitted by the University of Berkeley on July 22, 1999.  While the
clause itself mentions Lawrence Berkeley Laboratory, UCB is the sole
copyright holder of this file.

Reviewed by: imp, emaste, eadler
MFC after: 2 weeks

10 years agoPull in r201021 from upstream libc++ trunk:
dim [Thu, 13 Mar 2014 23:09:48 +0000 (23:09 +0000)]
Pull in r201021 from upstream libc++ trunk:

  Fix for PR18735 - self-assignment for map/multimap gives incorrect
  results in C++03

(Please note: that is an LLVM PR identifier, not a FreeBSD one.)

Reported by: rakuco
MFC after: 3 days

10 years agoReport ZVOL block size as GEOM stripesize.
mav [Thu, 13 Mar 2014 19:26:26 +0000 (19:26 +0000)]
Report ZVOL block size as GEOM stripesize.

MFC after: 2 weeks

10 years agoConnect 64-bit boot ficl to the build
emaste [Thu, 13 Mar 2014 19:26:23 +0000 (19:26 +0000)]
Connect 64-bit boot ficl to the build

It is not yet used, but this will ensure it doesn't get broken.

Sponsored by: The FreeBSD Foundation

10 years agoReplace 4.4BSD Lite's unix domain socket backpressure hack with a cleaner
asomers [Thu, 13 Mar 2014 18:42:12 +0000 (18:42 +0000)]
Replace 4.4BSD Lite's unix domain socket backpressure hack with a cleaner
mechanism, based on the new SB_STOP sockbuf flag.  The old hack dynamically
changed the sending sockbuf's high water mark whenever adding or removing
data from the receiving sockbuf.  It worked for stream sockets, but it never
worked for SOCK_SEQPACKET sockets because of their atomic nature.  If the
sockbuf was partially full, it might return EMSGSIZE instead of blocking.

The new solution is based on DragonFlyBSD's fix from commit
3a6117bbe0ed6a87605c1e43e12a1438d8844380 on 2008-05-27.  It adds an SB_STOP
flag to sockbufs.  Whenever uipc_send surpasses the socket's size limit, it
sets SB_STOP on the sending sockbuf.  sbspace() will then return 0 for that
sockbuf, causing sosend_generic and friends to block.  uipc_rcvd will
likewise clear SB_STOP.  There are two fringe benefits: uipc_{send,rcvd} no
longer need to call chgsbsize() on every send and receive because they don't
change the sockbuf's high water mark.  Also, uipc_sense no longer needs to
acquire the UIPC linkage lock, because it's simpler to compute the
st_blksizes.

There is one drawback: since sbspace() will only ever return 0 or the
maximum, sosend_generic will allow the sockbuf to exceed its nominal maximum
size by at most one packet of size less than the max.  I don't think that's
a serious problem.  In fact, I'm not even positive that FreeBSD guarantees a
socket will always stay within its nominal size limit.

sys/sys/sockbuf.h
Add the SB_STOP flag and adjust sbspace()

sys/sys/unpcb.h
Delete the obsolete unp_cc and unp_mbcnt fields from struct unpcb.

sys/kern/uipc_usrreq.c
Adjust uipc_rcvd, uipc_send, and uipc_sense to use the SB_STOP
backpressure mechanism.  Removing obsolete unpcb fields from
db_show_unpcb.

tests/sys/kern/unix_seqpacket_test.c
Clear expected failures from ATF.

Obtained from: DragonFly BSD
PR: kern/185812
Reviewed by: silence from freebsd-net@ and rwatson@
MFC after: 3 weeks
Sponsored by: Spectra Logic Corporation

10 years agoAdd amd64 EFI headers
emaste [Thu, 13 Mar 2014 18:17:18 +0000 (18:17 +0000)]
Add amd64 EFI headers

Sponsored by: The FreeBSD Foundation

10 years agoFix pw(8) deletion of group "username" on userdel even if group "username"
dteske [Thu, 13 Mar 2014 18:16:42 +0000 (18:16 +0000)]
Fix pw(8) deletion of group "username" on userdel even if group "username"
is not associated with user "username". E.g., user "foo" has primary group
"wheel" and is unassociated with group "foo", yet userdel would delete the
group "foo" when deleting user "foo" (despite the fact that user "foo" is
not associated with group "foo" in any way).

Patch committed with minor style(9) changes.

PR: bin/169471
Submitted by: Alexander Pyhalov <apyhalov@gmail.com>

10 years agoCorrect type for malloc().
jhb [Thu, 13 Mar 2014 18:11:42 +0000 (18:11 +0000)]
Correct type for malloc().

Submitted by: "Conrad Meyer" <conrad.meyer@isilon.com>

10 years agoFix pointer type in call to malloc
eadler [Thu, 13 Mar 2014 16:51:40 +0000 (16:51 +0000)]
Fix pointer type in call to malloc

Submitted by: Meyer, Conrad conrad.meyer@isilon.com

10 years agoFix pointer type in call to malloc
eadler [Thu, 13 Mar 2014 16:51:01 +0000 (16:51 +0000)]
Fix pointer type in call to malloc

Submitted by: Meyer, Conrad conrad.meyer@isilon.com

10 years agoremove link to the missing AMD Geode LX SB man page... we can add it
jmg [Thu, 13 Mar 2014 16:19:36 +0000 (16:19 +0000)]
remove link to the missing AMD Geode LX SB man page... we can add it
back once someone cares enough to write one..

10 years agoAdd MSI support to puc(9)
rstone [Thu, 13 Mar 2014 15:57:25 +0000 (15:57 +0000)]
Add MSI support to puc(9)

Add support for MSI interrupts in the puc(9) driver.  By default the driver
will prefer MSI interrupts to legacy interrupts.  A tunable,
hw.puc.msi_disable, has been added to force the allocation of legacy
interrupts.

Reviewed by: jhb@
MFC after: 2 weeks
Sponsored by: Sandvine Inc.

10 years agoTo avoid missing a chance to cancel thread, call _pthread_testcancel at the
davidxu [Thu, 13 Mar 2014 06:54:10 +0000 (06:54 +0000)]
To avoid missing a chance to cancel thread, call _pthread_testcancel at the
beginning of _sem_timedwait.

Submitted by: Eric van Gyzen &lt; eric at vangyzen dot net &gt;
MFC after: 3 days

10 years agoConnect the hyperv drivers to the build.
gjb [Thu, 13 Mar 2014 05:17:53 +0000 (05:17 +0000)]
Connect the hyperv drivers to the build.

MFC after: 5 days
X-MFC-With: r263105
Sponsored by: The FreeBSD Foundation

10 years agoAdd hyperv manual pages provided by Microsoft, formatted
gjb [Thu, 13 Mar 2014 05:11:56 +0000 (05:11 +0000)]
Add hyperv manual pages provided by Microsoft, formatted
for FreeBSD standards.  Very little, if any, content was
modified.

These are not yet linked to the build.

Submitted by: Abhishek Gupta (abgupta!microsoft dot com)
Sponsored by: The FreeBSD Foundation

10 years agoSince 32-bit if_baudrate isn't enough to describe a baud rate of a 10 Gbit
glebius [Thu, 13 Mar 2014 03:42:24 +0000 (03:42 +0000)]
Since 32-bit if_baudrate isn't enough to describe a baud rate of a 10 Gbit
interface, in the r241616 a crutch was provided. It didn't work well, and
finally we decided that it is time to break ABI and simply make if_baudrate
a 64-bit value. Meanwhile, the entire struct if_data was reviewed.

o Remove the if_baudrate_pf crutch.

o Make all fields of struct if_data fixed machine independent size. The
  notion of data (packet counters, etc) are by no means MD. And it is a
  bug that on amd64 we've got a 64-bit counters, while on i386 32-bit,
  which at modern speeds overflow within a second.

  This also removes quite a lot of COMPAT_FREEBSD32 code.

o Give 16 bit for the ifi_datalen field. This field was provided to
  make future changes to if_data less ABI breaking. Unfortunately the
  8 bit size of it had effectively limited sizeof if_data to 256 bytes.

o Give 32 bits to ifi_mtu and ifi_metric.
o Give 64 bits to the rest of fields, since they are counters.

__FreeBSD_version bumped.

Discussed with: emax
Sponsored by: Netflix
Sponsored by: Nginx, Inc.

10 years agoPut the offset of the CRC32C in csum_data instead of 0.
tuexen [Wed, 12 Mar 2014 17:18:15 +0000 (17:18 +0000)]
Put the offset of the CRC32C in csum_data instead of 0.
The virtio driver needs the offset to be stored in csum_data,
like in the case for UDP and TCP.

The virtio problem was reported by
Niu Zhixiong <kaiaixi@gmail.com>, who helped in debugging
and testing the patch.

MFC after: 3 days

10 years agoInitialize paddr to handle the case of zero size.
kib [Wed, 12 Mar 2014 16:38:55 +0000 (16:38 +0000)]
Initialize paddr to handle the case of zero size.

Reported and reviewed by: Conrad Meyer <cemeyer@uw.edu>
MFC after: 1 week

10 years agoSCTP uses CRC32C and not Adler anymore. While there change the reference
tuexen [Wed, 12 Mar 2014 15:30:40 +0000 (15:30 +0000)]
SCTP uses CRC32C and not Adler anymore. While there change the reference
to RFC 4960.
This does not change any code, just comments.

MFC after: 3 days

10 years agowlanstats: print timestamp
eadler [Wed, 12 Mar 2014 15:14:55 +0000 (15:14 +0000)]
wlanstats: print timestamp

Print timestamp in addition to data for more useful debugging.

Discussed with: adrian

10 years agoDo not vdrop() the tmpfs vnode until it is unlocked. The hold
kib [Wed, 12 Mar 2014 15:13:57 +0000 (15:13 +0000)]
Do not vdrop() the tmpfs vnode until it is unlocked.  The hold
reference might be the last, and then vdrop() would free the vnode.

Reported and tested by: bdrewery
MFC after: 1 week

10 years agoSince both netinet/ and netinet6/ call into netipsec/ and netpfil/,
glebius [Wed, 12 Mar 2014 14:29:08 +0000 (14:29 +0000)]
Since both netinet/ and netinet6/ call into netipsec/ and netpfil/,
the protocol specific mbuf flags are shared between them.

- Move all M_FOO definitions into a single place: netinet/in6.h, to
  avoid future  clashes.
- Resolve clash between M_DECRYPTED and M_SKIP_FIREWALL which resulted
  in a failure of operation of IPSEC and packet filters.

Thanks to Nicolas and Georgios for all the hard work on bisecting,
testing and finally finding the root of the problem.

PR: kern/186755
PR: kern/185876
In collaboration with: Georgios Amanakis <gamanakis gmail.com>
In collaboration with: Nicolas DEFFAYET <nicolas-ml deffayet.com>
Sponsored by: Nginx, Inc.

10 years agoMake ether_line really report an error when all input is invalid.
jmmv [Wed, 12 Mar 2014 12:27:13 +0000 (12:27 +0000)]
Make ether_line really report an error when all input is invalid.

The previous code failed to return an error condition when the whole input
was invalid due to improper handling of the sscanf return value.  Actually,
this failure was properly being caught by a test in
tools/regression/lib/libc/net/test-ether.t but was not noticed because
these tests are never run.  (On my way to fixing that ;-)

The fix applied here resembles the implementation of ether_line in NetBSD
modulo the setting of an errno value (which is not documented as an
expectation in the manpage anyway).

10 years agoFix description of WITHOUT_BMAKE's purpose.
jmmv [Wed, 12 Mar 2014 11:53:35 +0000 (11:53 +0000)]
Fix description of WITHOUT_BMAKE's purpose.

This variable exists to select fmake, not bmake.  (I suspect the comment
might have come from a time when this was named WITH_BMAKE.)

10 years agoRemove broken tests for eui64_line.
jmmv [Wed, 12 Mar 2014 10:59:51 +0000 (10:59 +0000)]
Remove broken tests for eui64_line.

This function is not public and brooks (initial committer adding the code)
suggests the deletion of the tests (which I don't know if they work)
instead of changing the visibility of the function.

10 years agoMake the strerror tests work without libtap.
jmmv [Wed, 12 Mar 2014 10:45:22 +0000 (10:45 +0000)]
Make the strerror tests work without libtap.

Just replace the simple calls to the library with ad-hoc code.  We should
later rewrite these with the ATF libraries anyway, which are part of the
base system.

10 years agoTurn a test precondition into a skip in the mdconfig tests.
jmmv [Wed, 12 Mar 2014 10:42:58 +0000 (10:42 +0000)]
Turn a test precondition into a skip in the mdconfig tests.

Tests that cannot be run because a precondition is not met should be
marked as skipped, not failed.  Do this for the tests in mdconfig that
first check if the caller user is root.

10 years agoFix sa tests.
jmmv [Wed, 12 Mar 2014 10:41:14 +0000 (10:41 +0000)]
Fix sa tests.

Small divergences in the output padding made some sa tests fail.  Just
trim all whitespace from the outputs and the golden files so comparisons
are less fragile and the tests pass again.

10 years agoOnly run the make tests when make is fmake.
jmmv [Wed, 12 Mar 2014 10:38:32 +0000 (10:38 +0000)]
Only run the make tests when make is fmake.

Because bmake is the default make being built, many of the tests here
fail due to differences between the two.  Just skip the tests for now
when using fmake.

10 years agoFix lastcomm tests under amd64.
jmmv [Wed, 12 Mar 2014 10:35:22 +0000 (10:35 +0000)]
Fix lastcomm tests under amd64.

Force the use of TZ=UTC and adjust data files accordingly.  I have no means
to verify that the data files for the other architectures are valid.

10 years agoUse correct types for sizeof() in the calculations for the malloc(9) sizes [1].
kib [Wed, 12 Mar 2014 10:25:26 +0000 (10:25 +0000)]
Use correct types for sizeof() in the calculations for the malloc(9) sizes [1].
While there, remove unneeded checks for failed allocations with M_WAITOK flag.

Submitted by: Conrad Meyer <cemeyer@uw.edu> [1]
MFC after: 1 week

10 years agoThe auio structure is only initialized when the vnode is symlink,
kib [Wed, 12 Mar 2014 10:23:51 +0000 (10:23 +0000)]
The auio structure is only initialized when the vnode is symlink,
avoid reading from it otherwise.

Submitted by: Conrad Meyer <cemeyer@uw.edu>
MFC after: 1 week

10 years agoMake ministat CRNL tolerant by stripping all isspace() from the tail
phk [Wed, 12 Mar 2014 08:54:29 +0000 (08:54 +0000)]
Make ministat CRNL tolerant by stripping all isspace() from the tail
end of input lines.

10 years agoAvoid segment fault when attempting to clean up cylinder group
mckusick [Wed, 12 Mar 2014 01:28:21 +0000 (01:28 +0000)]
Avoid segment fault when attempting to clean up cylinder group
buffer cache.

PR: 187221
Submitted by: Petr Lampa <lampa@fit.vutbr.cz>
Obtained from: Petr Lampa <lampa@fit.vutbr.cz>
MFC after: 1 week

10 years agoDelete stray clause 3 (Advertising clause) and renumber while i'm
imp [Tue, 11 Mar 2014 23:41:35 +0000 (23:41 +0000)]
Delete stray clause 3 (Advertising clause) and renumber while i'm
here.

Approved by: alc@

10 years agoRemove #include <machine/asmacros.h> from files that don't need it.
ian [Tue, 11 Mar 2014 22:47:04 +0000 (22:47 +0000)]
Remove #include <machine/asmacros.h> from files that don't need it.

10 years agoRemove the unreferenced DATA() macro. That leaves only GET_CURTHREAD_PTR()
ian [Tue, 11 Mar 2014 22:41:34 +0000 (22:41 +0000)]
Remove the unreferenced DATA() macro. That leaves only GET_CURTHREAD_PTR()
which was added by cognet in 2012, so remove the no-longer-applicable
license stuff that referred to all the old contents, and put in a
standard 2-clause BSD license (to cover the 6 lines of useful code left
in here).

10 years agoDon't try to return a vector to a caller that only cares if a vector
tychon [Tue, 11 Mar 2014 22:12:12 +0000 (22:12 +0000)]
Don't try to return a vector to a caller that only cares if a vector
is pending or not.

Approved by: neel (co-mentor)

10 years agoEnhance the mechanism that lets you configure the ubldr boot device by
ian [Tue, 11 Mar 2014 22:02:49 +0000 (22:02 +0000)]
Enhance the mechanism that lets you configure the ubldr boot device by
setting the u-boot environment variable loaderdev=.  It used to accept only
'disk' or 'net'.  Now it allows specification of unit, slice, and partition
as well.  In addition to the generic 'disk' it also accepts specific
storage device types such as 'mmc' or 'sata'.

If there isn't a loaderdev env var, the historical behavior is maintained.
It will use the first storage device it finds, or a network device if
no working storage device exists.

99% of the work on this was done by Patrick Kelsey, but I made some
changes, so if anything goes wrong, blame me.

Submitted by: Patrick Kelsey <kelsey@ieee.org>

10 years agoGarbage collect the old way of adding the libstdc++ include directories
dim [Tue, 11 Mar 2014 21:43:10 +0000 (21:43 +0000)]
Garbage collect the old way of adding the libstdc++ include directories
in clang's InitHeaderSearch.cpp.  This has been superseded by David
Chisnall's commit in r255321.

Moreover, if libc++ is used, the libstdc++ include directories should
not be in the search path at all.  These directories are now only used
if you pass -stdlib=libstdc++.

MFC after: 3 days
X-MFC-With: r261991

10 years agoRepair recognition of "CC" as an alias for the C++ compiler, since it
dim [Tue, 11 Mar 2014 21:11:43 +0000 (21:11 +0000)]
Repair recognition of "CC" as an alias for the C++ compiler, since it
was silently broken by upstream for a Windows-specific use-case.

Apparently some versions of CMake still rely on this archaic feature...

Reported by: rakuco
MFC after: 3 days
X-MFC-With: r261991

10 years agoMFV of 263039, tzdata2014a:
edwin [Tue, 11 Mar 2014 20:32:23 +0000 (20:32 +0000)]
MFV of 263039, tzdata2014a:

- Fix historical info about asia/Zion, Ukraine
- Fiji starts DST at 02:00 instead of 03:00
- Turkey will move to DST at 31 March this year.

10 years agoRemove clause 3 (the advertising clause), per the regent's letter.
imp [Tue, 11 Mar 2014 17:20:50 +0000 (17:20 +0000)]
Remove clause 3 (the advertising clause), per the regent's letter.

10 years agoRemove clause 3 (advertising clause), per regent's letter.
imp [Tue, 11 Mar 2014 17:08:45 +0000 (17:08 +0000)]
Remove clause 3 (advertising clause), per regent's letter.

10 years agoReplace the userspace atpic stub with a more functional vmm.ko model.
tychon [Tue, 11 Mar 2014 16:56:00 +0000 (16:56 +0000)]
Replace the userspace atpic stub with a more functional vmm.ko model.

New ioctls VM_ISA_ASSERT_IRQ, VM_ISA_DEASSERT_IRQ and VM_ISA_PULSE_IRQ
can be used to manipulate the pic, and optionally the ioapic, pin state.

Reviewed by: jhb, neel
Approved by: neel (co-mentor)

10 years agoUse panic rather than printf to "handle" an arm26 address exception
ian [Tue, 11 Mar 2014 16:53:03 +0000 (16:53 +0000)]
Use panic rather than printf to "handle" an arm26 address exception
(should never happen on arm32).  Pass the right arguments to panic for
the reset exception (which also should never happen).

10 years agoNo functional changes. Rewrite comments, use tabs consistantly, reorder
ian [Tue, 11 Mar 2014 16:48:46 +0000 (16:48 +0000)]
No functional changes.  Rewrite comments, use tabs consistantly, reorder
some of the functions so that similar things are grouped together.

10 years agoRemove some unnecessary indirection and jump right to the handler functions.
ian [Tue, 11 Mar 2014 15:46:03 +0000 (15:46 +0000)]
Remove some unnecessary indirection and jump right to the handler functions.

10 years agoSupport Last-Modified behind proxies which return UTC instead of GMT.
bdrewery [Tue, 11 Mar 2014 13:47:11 +0000 (13:47 +0000)]
Support Last-Modified behind proxies which return UTC instead of GMT.

The standard states that GMT must be used, but that UTC is equivalent. Still
parse UTC as otherwise this causes problems for pkg(8). It will refetch
the repository every time 'pkg update' or other remote operations
are used behind these proxies.

RFC2616: "All HTTP date/time stamps MUST be represented in Greenwich Mean
Time (GMT), without exception. For the purposes of HTTP, GMT is exactly equal
to UTC (Coordinated Universal Time).""

Approved by: bapt (mentor)
Reviewed by: des, peter
Sponsored by: EMC / Isilon Storage Division
MFC after: 1 week

10 years agoxen: add a hook to perform AP startup
royger [Tue, 11 Mar 2014 10:27:57 +0000 (10:27 +0000)]
xen: add a hook to perform AP startup

AP startup on PVH follows the PV method, so we need to add a hook in
order to diverge from bare metal.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

amd64/amd64/machdep.c:
 - Add hook for start_all_aps on native (using native_start_all_aps
   defined in mp_machdep).

amd64/amd64/mp_machdep.c:
 - Make some variables global because they will also be used by the
   Xen PVH AP startup code.
 - Use the start_all_aps hook to start APs.
 - Rename start_all_aps to native_start_all_aps.

amd64/include/smp.h:
 - Add declaration for native_start_all_aps.

x86/include/init.h:
 - Declare start_all_aps hook in init_ops.

x86/xen/pv.c:
 - Pick external declarations from mp_machdep.
 - Introduce Xen PV code to start APs on PVH.
 - Set start_all_aps init hook to use the Xen PVH implementation.

10 years agoxen: changes to hvm code in order to support PVH guests
royger [Tue, 11 Mar 2014 10:26:53 +0000 (10:26 +0000)]
xen: changes to hvm code in order to support PVH guests

On PVH we don't need to init the shared info page, or disable emulated
devices. Also, make sure PV IPIs are set before starting the APs.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

x86/xen/hvm.c:
 - Return early from functions that are no-ops on Xen PVH guests.
 - In order to make sure PV IPIs are setup before AP startup,
   initialize them in SI_SUB_SMP-1.

10 years agoxen: add hook for AP bootstrap memory reservation
royger [Tue, 11 Mar 2014 10:26:16 +0000 (10:26 +0000)]
xen: add hook for AP bootstrap memory reservation

This hook will only be implemented for bare metal, Xen doesn't require
any bootstrap code since APs are started in long mode with paging
enabled.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

amd64/amd64/machdep.c:
 - Set mp_bootaddress hook for bare metal.

x86/include/init.h:
 - Define mp_bootaddress in init_ops.

10 years agoxen: add an apic_enumerator for PVH
royger [Tue, 11 Mar 2014 10:25:08 +0000 (10:25 +0000)]
xen: add an apic_enumerator for PVH

On PVH there's no ACPI, so the CPU enumeration must be implemented
using Xen hypercalls.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

x86/xen/pvcpu_enum.c:
 - Enumerate avaiable vCPUs on PVH by using the VCPUOP_is_up
   hypercall.
 - Set vcpu_id for PVH guests.

conf/files.amd64:
 - Include the PV CPU enumerator in the XENHVM build.

10 years agoxen: use the same hypercall mechanism for XEN and XENHVM
royger [Tue, 11 Mar 2014 10:24:13 +0000 (10:24 +0000)]
xen: use the same hypercall mechanism for XEN and XENHVM

Currently XEN (PV) and XENHVM (PVHVM) ports use different ways to
issue hypercalls, unify this by filling the hypercall_page under HVM
also.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

amd64/include/xen/hypercall.h:
 - Unify Xen hypercall code by always using the PV way.

i386/i386/locore.s:
 - Define hypercall_page on i386 XENHVM.

x86/xen/hvm.c:
 - Fill hypercall_page on XENHVM kernels using the HVM method (only
   when running as an HVM guest).

10 years agoxen: implement hook to fetch and parse e820 memory map
royger [Tue, 11 Mar 2014 10:23:03 +0000 (10:23 +0000)]
xen: implement hook to fetch and parse e820 memory map

e820 memory map is fetched using a hypercall under Xen PVH, so add a
hook to init_ops in oder to diverge from bare metal and implement a
Xen variant.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

x86/include/init.h:
 - Add a parse_memmap hook to init_ops, that will be called to fetch
   and parse the memory map.

amd64/amd64/machdep.c:
 - Decouple the fetch and the parse of the memmap, so the parse
   function can be shared with Xen code.
 - Move code around in order to implement the parse_memmap hook.

amd64/include/pc/bios.h:
 - Declare bios_add_smap_entries (implemented in machdep.c).

x86/xen/pv.c:
 - Implement fetching of e820 memmap when running as a PVH guest by
   using the XENMEM_memory_map hypercall.

10 years agoxen: implement an early timer for Xen PVH
royger [Tue, 11 Mar 2014 10:20:42 +0000 (10:20 +0000)]
xen: implement an early timer for Xen PVH

When running as a PVH guest, there's no emulated i8254, so we need to
use the Xen PV timer as the early source for DELAY. This change allows
for different implementations of the early DELAY function and
implements a Xen variant for it.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

dev/xen/timer/timer.c:
dev/xen/timer/timer.h:
 - Implement Xen early delay functions using the PV timer and declare
   them.

x86/include/init.h:
 - Add hooks for early clock source initialization and early delay
   functions.

i386/i386/machdep.c:
pc98/pc98/machdep.c:
amd64/amd64/machdep.c:
 - Set early delay hooks to use the i8254 on bare metal.
 - Use clock_init (that will in turn make use of init_ops) to
   initialize the early clock source.

amd64/include/clock.h:
i386/include/clock.h:
 - Declare i8254_delay and clock_init.

i386/xen/clock.c:
 - Rename DELAY to i8254_delay.

x86/isa/clock.c:
 - Introduce clock_init that will take care of initializing the early
   clock by making use of the init_ops hooks.
 - Move non ISA related delay functions to the newly introduced delay
   file.

x86/x86/delay.c:
 - Add moved delay related functions.
 - Implement generic DELAY function that will use the init_ops hooks.

x86/xen/pv.c:
 - Set PVH hooks for the early delay related functions in init_ops.

conf/files.amd64:
conf/files.i386:
conf/files.pc98:
 - Add delay.c to the kernel build.

10 years agoxen: rework xen timer so it can be used early in boot process
royger [Tue, 11 Mar 2014 10:16:17 +0000 (10:16 +0000)]
xen: rework xen timer so it can be used early in boot process

This should not introduce any functional change, and makes the
functions suitable to be called before we have actually mapped the
vcpu_info struct on a per-cpu basis.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

dev/xen/timer/timer.c:
 - Remove citrical_{enter/exit}, the clock code will already be called
   with preemption disabled when needed. Add a comment to that regard
   in xentimer_get_timecount.
 - Allow xen_fetch_vcpu_time to be called with a specifc vcpu_info
   that will be used to fetch current time.
 - Assert that xentimer_et_start will always be called with preemption
   disabled.

10 years agoamd64: introduce hook for custom preload metadata parsers
royger [Tue, 11 Mar 2014 10:15:25 +0000 (10:15 +0000)]
amd64: introduce hook for custom preload metadata parsers

Add hooks to amd64 in order to have diverging implementations, since
on Xen PV the metadata is passed to the kernel in a different form.

Approbed by: gibbs
Sponsored by: Citrix Systems R&D

amd64/amd64/machdep.c:
 - Define init_ops for native.
 - Put native code inside of native_parse_preload_data hook.
 - Call the parse_preload_data in order to fill the metadata info.

x86/include/init.h:
 - Declare the init_ops struct.

x86/xen/pv.c:
 - Declare xen_init_ops that contains the Xen PV implementation of
   init_ops.
 - Implement the parse_preload_data for Xen PVH, the info is fetched
   from HYPERVISOR_start_info->cmd_line as provided by Xen.

10 years agohowto_names: unify declaration
royger [Tue, 11 Mar 2014 10:13:06 +0000 (10:13 +0000)]
howto_names: unify declaration

Approved by: gibbs
Sponsored by: Citrix Systems R&D

boot/i386/efi/bootinfo.c:
boot/i386/libi386/bootinfo.c:
boot/ia64/common/bootinfo.c:
boot/powerpc/ofw/metadata.c:
boot/powerpc/ps3/metadata.c:
boot/sparc64/loader/metadata.c:
boot/uboot/common/metadata.c:
boot/userboot/userboot/bootinfo.c:
i386/xen/xen_machdep.c:
 - Include sys/boot.h
 - Remove custom definition of howto_names.

sys/boot.h:
 - Define howto_names.

x86/xen/pv.c:
 - Include sys/boot.h

10 years agoxen: add and enable Xen console for PVH guests
royger [Tue, 11 Mar 2014 10:09:23 +0000 (10:09 +0000)]
xen: add and enable Xen console for PVH guests

This adds and enables the PV console used on XEN kernels to
GENERIC/XENHVM kernels in order for it to be used on PVH.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

dev/xen/console/console.c:
 - Define console_page.
 - Move xc_printf debug function from i386 XEN code to generic console
   code.
 - Rework xc_printf.
 - Use xen_initial_domain instead of open-coded checks for Dom0.
 - Gate the attach of the PV console to PV(H) guests.

dev/xen/console/xencons_ring.c:
 - Allow the PV Xen console to output earlier by directly signaling
   the event channel in start_info if the event channel is not yet
   initialized.
 - Use HYPERVISOR_start_info instead of xen_start_info.

i386/include/xen/xen-os.h:
 - Remove prototype for xc_printf since it's now declared in global
   xen-os.h

i386/xen/xen_machdep.c:
 - Remove previous version of xc_printf.
 - Remove definition of console_page (now it's defined in the console
   itself).
 - Fix some printf formatting errors.

x86/xen/pv.c:
 - Add some early boot debug messages using xc_printf.
 - Set console_page based on the value passed in start_info.

xen/xen-os.h:
 - Declare console_page and add prototype for xc_printf.

10 years agoxen: add macro to detect if running as Dom0
royger [Tue, 11 Mar 2014 10:07:55 +0000 (10:07 +0000)]
xen: add macro to detect if running as Dom0

Approved by: gibbs
Sponsored by: Citrix Systems R&D

xen/xen-os.h:
 - Add macro to detect if running as Dom0.

10 years agoxen: add PV/PVH kernel entry point
royger [Tue, 11 Mar 2014 10:07:01 +0000 (10:07 +0000)]
xen: add PV/PVH kernel entry point

Add the PV/PVH entry point and the low level functions for PVH
early initialization.

Approved by: gibbs
Sponsored by: Citrix Systems R&D

amd64/amd64/genassym.c:
 - Add __FreeBSD_version define to assym.s so it can be used for the
   Xen notes.

amd64/amd64/locore.S:
 - Make bootstack global so it can be used from Xen kernel entry
   point.

amd64/amd64/xen-locore.S:
 - Add Xen notes to the kernel.
 - Add the Xen PV entry point, that is going to call hammer_time_xen.

amd64/include/asmacros.h:
 - Add ELFNOTE macros.

i386/xen/xen_machdep.c:
 - Define HYPERVISOR_start_info for the XEN i386 PV port, which is
   going to be used in some shared code between PV and PVH.

x86/xen/hvm.c:
 - Define HYPERVISOR_start_info for the PVH port.

x86/xen/pv.c:
 - Introduce hammer_time_xen which is going to perform early setup for
   Xen PVH:
    - Setup shared Xen variables start_info, shared_info and
      xen_store.
    - Set guest type.
    - Create initial page tables as FreeBSD expects to find them.
    - Call into native init function (hammer_time).

xen/xen-os.h:
 - Declare HYPERVISOR_start_info.

conf/files.amd64:
 - Add amd64/amd64/locore.S and x86/xen/pv.c to the list of files.

10 years agoamd64/i386: switch IPI handlers to C code.
royger [Tue, 11 Mar 2014 10:03:29 +0000 (10:03 +0000)]
amd64/i386: switch IPI handlers to C code.

Move asm IPIs handlers to C code, so both Xen and native IPI handlers
share the same code.

Reviewed by: jhb
Approved by: gibbs
Sponsored by: Citrix Systems R&D

amd64/amd64/apic_vector.S:
i386/i386/apic_vector.s:
 - Remove asm coded IPI handlers and instead call the newly introduced
   C variants.

amd64/amd64/mp_machdep.c:
i386/i386/mp_machdep.c:
 - Add C coded clones to the asm IPI handlers (moved from
   x86/xen/hvm.c).

i386/include/smp.h:
amd64/include/smp.h:
 - Add prototypes for the C IPI handlers.

x86/xen/hvm.c:
 - Move the C IPI handlers to mp_machdep and call those in the Xen IPI
   handlers.

i386/xen/mp_machdep.c:
 - Add dummy IPI handlers to the i386 Xen PV port (this port doesn't
   support SMP).

10 years agoFixed MSI interrupt allocation and handling.
edavis [Tue, 11 Mar 2014 06:07:12 +0000 (06:07 +0000)]
Fixed MSI interrupt allocation and handling.
Fixed a DMA mapping leak that occurs when defragmenting packet chains.

Approved by: davidch (mentor)
MFC after: 1 week

10 years agoRevert r262994 for now, it fails to boot on armv5.
ian [Tue, 11 Mar 2014 04:25:12 +0000 (04:25 +0000)]
Revert r262994 for now, it fails to boot on armv5.

10 years agoPass the actual baudrate to tty_init_console(). This defines the initial
marcel [Tue, 11 Mar 2014 03:20:10 +0000 (03:20 +0000)]
Pass the actual baudrate to tty_init_console(). This defines the initial
baudrate of the device special file, and makes sure that on open(2) the
UART is programmed with the correct baudrate. This then eliminates the
need in uart_tty_param() to override the speed setting.

10 years agoNow that the PUSHFRAME and PULLFRAME macros are used only in the swi
ian [Tue, 11 Mar 2014 03:19:43 +0000 (03:19 +0000)]
Now that the PUSHFRAME and PULLFRAME macros are used only in the swi
entry/exit code, they don't need to be macros.  Now they're just inline
code, and rewritten to use shorter instruction sequences.

10 years agoallow the kern.cryptodevallowsoft sysctl to enable symetric/hashes too...
jmg [Tue, 11 Mar 2014 01:45:46 +0000 (01:45 +0000)]
allow the kern.cryptodevallowsoft sysctl to enable symetric/hashes too...
This will allow us to more easily test the software versions of these
routines...

Considering that we've never had an software asymetric implmentation,
it's doubtful anyone has this enabled...

10 years agosome minor clean up.. Always _ZERO memory so mtx_init won't panic...
jmg [Tue, 11 Mar 2014 01:41:09 +0000 (01:41 +0000)]
some minor clean up.. Always _ZERO memory so mtx_init won't panic...

use the proper macro instead of hand rolling it...

Reviewed by: jhb (only the malloc change)
MFC after: 1 week

10 years agolibbsdstat: fix warnings, set WARNS
eadler [Tue, 11 Mar 2014 01:10:44 +0000 (01:10 +0000)]
libbsdstat: fix warnings, set WARNS

libbsdstat can build with WARNS=6 with a one line change.

10 years agoCorrect a typo in nlm_find_host_by_addr(): the intention of the
delphij [Tue, 11 Mar 2014 00:25:55 +0000 (00:25 +0000)]
Correct a typo in nlm_find_host_by_addr(): the intention of the
code is to give "<unknown>" rather than comparing the buffer
against it.

MFC after: 2 weeks

10 years agoMFV r262983:
delphij [Tue, 11 Mar 2014 00:23:50 +0000 (00:23 +0000)]
MFV r262983:

4638 Panic in ZFS via rfs3_setattr()/rfs3_write(): dirtying snapshot!

illumos/illumos-gate@2144b121c08e0eb676cc6ca4662ebbc9f9c22fe3

10 years agoExport _libc_arm_fpu_present as a private symbol to be used by other
andrew [Tue, 11 Mar 2014 00:21:49 +0000 (00:21 +0000)]
Export _libc_arm_fpu_present as a private symbol to be used by other
system libraries, for example libm.

10 years agoArrange for arm fork_trampoline() to return to userland via the standard
ian [Mon, 10 Mar 2014 22:52:32 +0000 (22:52 +0000)]
Arrange for arm fork_trampoline() to return to userland via the standard
swi_exit code in exception.S instead of having its own inline expansion
of the DO_AST and PULLFRAME macros.  That means that now all references
to the PUSH/PULLFRAME and DO_AST macros are localized to exception.S,
so move the macros themselves into there and remove them from asmacros.h

10 years agoChange the way the asm GET_CURTHREAD_PTR() macro is defined so that code
ian [Mon, 10 Mar 2014 22:38:07 +0000 (22:38 +0000)]
Change the way the asm GET_CURTHREAD_PTR() macro is defined so that code
using it doesn't have to have an "AST_LOCALS" macro somewhere in the file.

10 years agoRepair a few minor mismerges from r262261 in the clang-sparc64 project
dim [Mon, 10 Mar 2014 21:58:38 +0000 (21:58 +0000)]
Repair a few minor mismerges from r262261 in the clang-sparc64 project
branch.  This is also to minimize differences with upstream.

MFC after: 3 weeks
X-MFC-With: r262613

10 years agoRemove vestigial global, no-longer used since SVN r262904.
dteske [Mon, 10 Mar 2014 21:37:40 +0000 (21:37 +0000)]
Remove vestigial global, no-longer used since SVN r262904.

10 years agoWhitespace.
dteske [Mon, 10 Mar 2014 21:35:27 +0000 (21:35 +0000)]
Whitespace.

10 years agoMove the exception vector table (so-called "page0" data) into exception.S
ian [Mon, 10 Mar 2014 19:36:26 +0000 (19:36 +0000)]
Move the exception vector table (so-called "page0" data) into exception.S
and eliminate vectors.S.  All low-level exception handling is now
consolidated into exception.S.

Along with moving the default FIQ handler, change it to disable FIQs
before returning.  An FIQ should never happen, but if it does, it's got
to be disabled as part of ignoring it.

In general, we have hand-wavy support for FIQs that probably hasn't been
used for 10 years and probably doesn't work (almost certainly doesn't
work for SMP because it only updates the vector on the current cpu).  This
change doesn't really make the overall situation any better or worse.

10 years agoEliminate irq_dispatch.S. Move the data items it contained into arm/intr.c
ian [Mon, 10 Mar 2014 18:10:09 +0000 (18:10 +0000)]
Eliminate irq_dispatch.S.  Move the data items it contained into arm/intr.c
and the functionality it provided into arm/exception.S.  Rename the main
irq handling routine from arm_handler_execute() to arm_irq_handler() to
make it more congruent with how other exception handlers are named, and
also update its signature to reflect what has long been reality: it is
passed just a trapframe pointer, no interrupt number argument.

10 years agoPass the size of the top-level table to map when mapping the table instead
jhb [Mon, 10 Mar 2014 16:07:45 +0000 (16:07 +0000)]
Pass the size of the top-level table to map when mapping the table instead
of the size of the pointer.

Reported by: Coverity
Coverity CID: 1147171

10 years agoAdd the makefile forgotten in previous commit
bapt [Mon, 10 Mar 2014 15:59:50 +0000 (15:59 +0000)]
Add the makefile forgotten in previous commit

10 years agoAdd a mailer.conf example to use dma
bapt [Mon, 10 Mar 2014 14:36:27 +0000 (14:36 +0000)]
Add a mailer.conf example to use dma

10 years agoUpdate libucl to 2014-03-03
bapt [Mon, 10 Mar 2014 10:39:29 +0000 (10:39 +0000)]
Update libucl to 2014-03-03

10 years agoUpdate libucl to 2014-03-02 version which fixes an important bug when parsing empty...
bapt [Mon, 10 Mar 2014 10:23:43 +0000 (10:23 +0000)]
Update libucl to 2014-03-02 version which fixes an important bug when parsing empty arrays

10 years agoIgnore USB keyboard driver calls from critical sections.
hselasky [Mon, 10 Mar 2014 08:52:30 +0000 (08:52 +0000)]
Ignore USB keyboard driver calls from critical sections.

Reported by: Oliver Pinter <oliver.pntr@gmail.com>
MFC after: 1 week

10 years agoAlso tag the current HAL power mode in ar9300_set_power_mode().
adrian [Mon, 10 Mar 2014 06:05:26 +0000 (06:05 +0000)]
Also tag the current HAL power mode in ar9300_set_power_mode().

10 years agoMigrate the chip power mode status to public ath_hal, rather than the
adrian [Mon, 10 Mar 2014 06:03:35 +0000 (06:03 +0000)]
Migrate the chip power mode status to public ath_hal, rather than the
private per-chip HAL.

This allows the ah_osdep.[ch] code to check whether the power state is
valid for doing chip programming.

It should be a no-op for normal driver work but it does require a
clean kernel/module rebuild, as the size of HAL structures have changed.

Now, this doesn't track whether the hardware is ACTUALLY awake,
as NETWORK_SLEEP wakes the chip up for a short period when traffic
is received.  This doesn't actually set the power mode to AWAKE, so
we have to be careful about how we touch things.

But it's enough to start down the path of implementing station mode
chipset power savings, as a large part of the silliness is making
sure the chip is awake during periodic calibration / ANI and
random places where transmit may be occuring.  I'd rather not a repeat
of debugging power save on ath9k, where races with calibration
and transmit path stuff took a couple years to shake out.

Tested:

* AR5416, STA mode