194214 Commits

Author SHA1 Message Date
andreast
3deab847d6 MFC r258778
Add a printf to inform about the logical memory block size which is in use
by the system. This might give a hint why a pSeries system is not booting.
2013-12-11 21:41:21 +00:00
andreast
82065403f7 MFC r258615
Take care to handle the full 16 byte buffer in the get/put routines. Also,
skip the VTERM header once when receiving data from the hypervisor call when
we have a HVTERMPROT connection.
2013-12-11 21:37:32 +00:00
andreast
edae181f18 MFC r258503
Limit the large page size to 16MB for now.
2013-12-11 20:56:23 +00:00
gjb
3a49f6f7cf MFC r257805, r257806, r257807, r257942:
r257805:
  Add a 'mini-memstick.img' release target, which will use the
  'bootonly.iso' components to create a smaller memory stick image.

  This is useful for system recovery, where a full memstick.img image
  is not necessarily needed (or wanted).  In addition, it is possible
  to do bootonly-style installation, where the base.txz, kernel.txz,
  etc. are fetched from a remote source.

  Provide backwards-compatible target (mini-memstick), to keep in sync
  with the targets documented in release/Makefile.

r257806:
  Remove extra target from 'memstick' that I forgot to remove before
  previous commit.

r257807:
  Update release(7) to include 'mini-memstick'.

r257942:
  Fix a few style nits.

Sponsored by:	The FreeBSD Foundation
2013-12-11 19:26:56 +00:00
pfg
de938e4059 MFC r256448, r257029;
Make di_blocks unsigned in UFS1 as is the case already for UFS2.
 Most of the code between UFS1 and UFS2 is shared so this change
 is pretty safe. Not only this makes UFS1 and 2 consistent but it
 also matches what NetBSD and MacOS X have for some years now.

UFS2: make di_extsize unsigned.
 di_extsize is the EA size and as such it should be unsigned.
 Adjust related types for consistency.

Reviewed by:	mckusick
2013-12-11 19:25:17 +00:00
dim
4c7f14937f MFC r259111:
Use correct casts in gcc's emmintrin.h for the first arguments of the
following builtin functions:

* __builtin_ia32_pslldi128() takes __v4si instead of __v8hi
* __builtin_ia32_psllqi128() takes __v2di instead of __v8hi
* __builtin_ia32_psradi128() takes __v4si instead of __v8hi

This should fix the following errors when building the LINT kernel with
gcc:

sys/crypto/aesni/aesni_wrap.c:191: error: incompatible type for argument 1 of
'__builtin_ia32_psradi128'
sys/crypto/aesni/aesni_wrap.c:195: error: incompatible type for argument 1 of
'__builtin_ia32_pslldi128'
2013-12-11 07:43:30 +00:00
dim
d6c28b7c7e MFC r259100:
Pull in r196658 from upstream clang trunk:

  CodeGen: Don't emit linkage on thunks that aren't emitted because they're
  vararg.

  This can happen when we're trying to emit a thunk with available_externally
  linkage with optimization enabled but bail because it doesn't make sense for
  vararg functions.

  [LLVM] PR18098.

This should fix clang "Broken module found, compilation aborted" errors when
building the qt4-based dvbcut port.

Reported by:	se
2013-12-11 07:34:34 +00:00
rmacklem
e5a94b0804 MFC: r257598
During code inspection, I spotted that there was a code path where
CLNT_CONTROL() would be called on "client" after it was
released via CLNT_RELEASE(). It was unlikely that this
code path gets executed and I have not heard of any problem
report caused by this bug. This patch fixes the code so that
this cannot happen.
2013-12-11 00:39:56 +00:00
np
2aa8caeed6 MFC r258692 (gnn).
Add constants for use in interrogating various fiber and copper connectors
most often used with network interfaces.

The SFF-8472 standard defines the information that can be retrieved
from an optic or a copper cable plugged into a NIC, most often
referred to as SFP+.  Examples of values that can be read
include the cable vendor's name, part number, date of manufacture
as well as running data such as temperature, voltage and tx
and rx power.

Copious comments on how to use these values with an I2C interface
are given in the header file itself.

Discussed with:	gnn
2013-12-11 00:17:13 +00:00
nwhitehorn
ebd6e46afc MFC r257345,257382,257388:
Implement extended LUN support. If PIM_EXTLUNS is set by a SIM, encode
the upper 32-bits of the LUN, if possible, into the target_lun field as
passed directly from the REPORT LUNs response. This allows extended LUN
support to work for all LUNs with zeros in the lower 32-bits, which covers
most addressing modes without breaking KBI. Behavior for drivers not
setting PIM_EXTLUNS is unchanged. No user-facing interfaces are modified.

Extended LUNs are stored with swizzled 16-bit word order so that, for
devices implementing LUN addressing (like SCSI-2), the numerical
representation of the LUN is identical with and without PIM_EXTLUNS. Thus
setting PIM_EXTLUNS keeps most behavior, and user-facing LUN IDs, unchanged.
This follows the strategy used in Solaris. A macro (CAM_EXTLUN_BYTE_SWIZZLE)
is provided to transform a lun_id_t into a uint64_t ordered for the wire.

This is the second part of work for full 64-bit extended LUN support and is
designed to a bridge for stable/10 to the final 64-bit LUN code. The
third and final part will involve widening lun_id_t to 64 bits and will
not be MFCed. This third part will break the KBI but will keep the KPI
unchanged so that all drivers that will care about this can be updated now
and not require code changes between HEAD and stable/10.

Reviewed by:	scottl
2013-12-10 22:55:22 +00:00
gavin
7d9ae8a27c Merge r257065 (by adrian) from head:
Fix a use-after-free node reference issue when waiting for a return
  from a management frame transmission.

  This bug is a bit loopy, so here goes.

  The underlying cause is pretty easy to understand - the node isn't
  referenced before passing into the callout, so if the node is deleted
  before the callout fires, it'll dereference free'd memory.

  The code path however is slightly more convoluted.

  The functions _say_ mgt_tx - ie management transmit - which is partially
  true.  Yes, that callback is attached to the mbuf for some management
  frames.  However, it's only for frames relating to scanning and
  authentication attempts.  It helpfully drives the VAP state back to
  "SCAN" if the transmission fails _OR_ (as I subsequently found out!)
  if the transmission succeeds but the state machine doesn't make progress
  towards being authenticated and active.

  Now, the code itself isn't terribly clear about this.

  It _looks_ like it's just handling the transmit failure case.

  However, when you look at what goes on in the transmit success case, it's
  moving the VAP state back to SCAN if it hasn't changed state since
  the time the callback was scheduled.  Ie, if it's in ASSOC or AUTH still,
  it'll go back to SCAN.  But if it has transitioned to the RUN state,
  the comparison will fail and it'll not transition things back to the
  SCAN state.

  So, to fix this, I decided to leave everything the way it is and merely
  fix the locking and remove the node reference.

  The _better_ fix would be to turn this callout into a "assoc/auth request"
  timeout callback and make the callout locked, thus eliminating all races.
  However, until all the drivers have been fixed so that transmit completions
  occur outside of any locking that's going on, it's going to be impossible
  to do this without introducing LORs.  So, I leave some of the evilness
  in there.

Candidate for 10.0.
2013-12-10 13:42:59 +00:00
gavin
02c40422cc Merge r256294 (by adrian) from head:
Fix the "am I a net80211 vap" check for bpf listeners.

  I changed it to use if_transmit a while ago but apparently with monitor
  mode the if_transmit method is overridden.

  This is (mostly) a workaround until a more permanent solution can be
  found.

Candidate for 10.0.

Submitted by:	Patrick Kelsey <kelsey@ieee.org>
2013-12-10 13:38:39 +00:00
gavin
a26c2c1c13 Merge r258758 (by adrian) from head:
Make sure any waiters on the scan results get notified if the scan task
  decides to do nothing.

  If this isn't done, then a scan request whilst a scan occurs in an
  active channel set or a completed channel set will hang.

Candidate for 10.0.
2013-12-10 13:36:56 +00:00
gavin
977caa62b9 Merge r257754 (by adrian) from head:
Don't return ENOBUFS if the transmit path handles the frame but queues
  it (eg in power save.)

10.0 candidate.

PR:		kern/183727
2013-12-10 13:35:04 +00:00
dim
837dce1466 MFC r259083:
For WARNS <= 3, change the clang warning flag -Wno-conversion to
-Wno-enum-conversion.  In earlier clang versions (before 3.2), the
latter did not exist, and suppressing enum conversion warnings was
really the goal of this warning suppression flag.

This should enable the same kind of warning again as was fixed by
r259072 ("incompatible integer to pointer conversion passing 'Elf_Addr'
(aka 'unsigned int') to parameter of type 'void *'"), and which was only
emitted by gcc.

Noticed by:	kib
2013-12-10 07:28:26 +00:00
dim
f972f6b92d MFC r259053:
Pull in r196590 from upstream clang trunk (by rdivacky):

  Move the body of GCCInstallationDetector ctor into an init() function
  and call it from its only user. The linux toolchain. This saves quite
  a lot of directory searching on other platforms.

See http://docs.freebsd.org/cgi/mid.cgi?51E6FAF5.3080802 for the
original discussion.  With this fix, the search for gcc installations is
completely eliminated on FreeBSD.

Reported by:	Kurt Lidl <lidl@pix.net>
2013-12-10 07:25:25 +00:00
gjb
fca381ba6d MFC r259079:
Add WITH_DVD to RELEASE_RMAKEFLAGS, otherwise it is not actually
  passed to 'make release'.

Sponsored by:	The FreeBSD Foundation
2013-12-10 00:35:33 +00:00
np
7777b8aff6 MFC r257654, r257772, r258441, r258689, r258698, r258879, r259048, and
r259103.

r257654:
cxgbe(4): Exclude MPS_RPLC_MAP_CTL (0x11114) from the register dump.  Turns
out it's a write-only register with strange side effects on read.

r257772:
cxgbe(4): Tidy up the display for payload memory statistics (pm_stats).

r258441:
cxgbe(4): update the internal list of device features.

r258689:
Disable an assertion that relies on some code[1] that isn't in HEAD yet.

r258698:
cxgbetool: "modinfo" command to display SFP+ module information.

r258879:
cxgbe(4):  T4_SET_SCHED_CLASS and T4_SET_SCHED_QUEUE ioctls to program
scheduling classes in the chip and to bind tx queue(s) to a scheduling
class respectively.  These can be used for various kinds of tx traffic
throttling (to force selected tx queues to drain at a fixed Kbps rate,
or a % of the port's total bandwidth, or at a fixed pps rate, etc.).

r259048:
Two new cxgbetool subcommands to set up scheduler classes and to bind
them to NIC queues.

r259103:
cxgbe(4): save a copy of the RSS map for each port for the driver's use.
2013-12-09 22:40:22 +00:00
peter
44822de64a MFC r259094 - Fix undocumented side effect of r256256 that changes/breaks
existing jails.  This burned us in the freebsd cluster yesterday.
2013-12-09 21:32:36 +00:00
bdrewery
fd4e78a5f4 Regenerate after r259138
Approved by:	bapt (implicit)
2013-12-09 21:07:57 +00:00
bdrewery
dee271d9cb MFC r258924:
Add missing period for WITHOUT_PKGBOOTSTRAP so that it matches all
  other entries.

Approved by:	bapt (implicit)
2013-12-09 20:47:50 +00:00
peter
57a89d6c38 Hoist all the mergeinfo up to the root in preparation for enforcing merges
to the root only.  All MFC's were rerecorded to the root.

Going forward, if an MFC includes mergeinfo, it will need to be made to
the root and committed from the root.  Merges with --ignore-ancestry
or diff | patch can go anywhere.

The mergeinfo in HEAD is in a bad state from years of neglect and manual
tampering and this was branched into 10.x.  This confuses the coalescing
code and prevents it from doing its job.

Approved by:	re (gjb, implicit)
2013-12-07 18:23:29 +00:00
gjb
5d113d96e5 Bump __FreeBSD_version to 1000700, to set it higher than what is in
releng/10.0 now.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2013-12-07 13:06:14 +00:00
gjb
945df93442 Set stable/10 to -PRERELEASE, now that releng/10.0 has been branched.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2013-12-07 11:33:07 +00:00
dteske
17574f5acb MFC r258927: Fix a regression introduced by SVN r257842 that prevents
Encryption from being enabled.

Approved by:	re (gjb)
2013-12-07 00:33:10 +00:00
delphij
4490be87f5 MFC r258948:
Support Hyper-V on i386:

 - Add 'hyperv' module into build;
 - Allow building Hyper-V support as part of the kernel;
 - Hook Hyper-V build into NOTES.

Approved by:	re (rodrigc)
2013-12-06 23:40:50 +00:00
delphij
335a1d42b1 MFC r258941:
Apply vendor improvements to oce(4) driver:

 - Add support to 40Gbps devices;
 - Add support to control adaptive interrupt coalescing (AIC)
   via sysctl;
 - Improve support of BE3 devices;

Many thanks to Emulex for their continued support of FreeBSD.

Submitted by:	Venkata Duvvuru <VenkatKumar.Duvvuru Emulex Com>
Approved by:	re (rodrigc)
2013-12-06 23:30:46 +00:00
cperciva
3cc5015bda MFC r258894: Make rc(8) re-source rc.conf upon receipt of SIGALRM.
The rc system aggressively caches the contents of /etc/rc.conf in order to
improve boot performance; this produces arguably astonishing (non-)results
if /etc/rc.conf is modified during the boot process.  This commit provides
a mechanism for explicitly requesting that rc.conf be reloaded.

Approved by:	re (rodrigc)
2013-12-06 20:48:53 +00:00
royger
dd1133fe21 MFC 258178:
Improve robustness of the Xen balloon driver.

sys/dev/xen/balloon/balloon.c:
	Remove unused and commented out code.

	Fix deadlock caused by performing a sleepable malloc
	while holding the balloon mutex.

	Perform proper accounting of the memory used by the domain.

Submitted by:	Roger Pau Monné
Sponsored by:	Citrix Systems R&D
Reviewed by:	gibbs
Approved by:	gibbs (mentor)
Approved by:	re (gjb)
2013-12-05 18:09:48 +00:00
royger
00083cffc4 MFC 258176:
Fix accounting for hw.realmem on the i386 and amd64 platforms.

sys/i386/i386/machdep.c:
sys/amd64/amd64/machdep.c:
	The value reported by FreeBSD as "real memory" when booting
	doesn't match what is later reported by sysctl as hw.realmem.
	This is due to the fact that the value printed during the
	boot process is fetched from smbios data (when possible),
	and accounts for holes in physical memory. On the other
	hand, the value of hw.realmem is unconditionally set to be
	one larger than the highest page of the physical address
	space.

	Fix this by setting hw.realmem to the same value printed
	during boot, this makes hw.realmem honour it's name and
	account properly for physical memory present in the system.

Submitted by:	Roger Pau Monné
Reviewed by:	gibbs
Approved by:	gibbs (mentor)
Approved by:	re (gjb)
2013-12-05 18:08:05 +00:00
royger
2cbf074029 MFC 257876:
On XenServer the "halt" message is used instead of "poweroff", which
makes FreeBSD halt but not poweroff (as expected when issuing a
shutdown from the VM manager). Fix this by using the same handler
for both "halt" and "poweroff".

NB: The "halt" signal seems to be used on XenServer only.  The OSS
    Xen toolstack (xl) uses "poweroff" instead.

Submitted by:	Roger Pau Monné
Sponsored by:	Citrix Systems R&D
Reviewed by:	gibbs
Approved by:	gibbs (mentor)
Approved by:	re (gjb)
2013-12-05 18:06:12 +00:00
sbruno
07f179266d MFC r257769 to stable/10
Fix powerd/states on AMD cpus.  Resolves issues with system reporting:
hwpstate0: set freq failed, err 6

Tested on FX-8150 and others.

PR:		kern/167018
Submitted by:	avg@
Approved by:	re (gjb)
2013-12-05 17:57:51 +00:00
trasz
d3ef2c7747 MFC r258842:
Grammar fix.

Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2013-12-05 16:29:22 +00:00
trasz
f6339a17f9 MFC r258841:
Fix typos.

Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2013-12-05 16:14:56 +00:00
yongari
10c81ac71b MFC r258830:
Add support for BCM57764, BCM57767, BCM57782, BCM57786 and BCM57787.
  PR:	184304
  Approved by:	re (rodrigc)
2013-12-05 06:13:59 +00:00
rodrigc
9a59cf510b MFC r258914
Update release notes.

Submitted by: skreuzer
Approved by: re (delphij)
2013-12-05 01:21:45 +00:00
gjb
5ddf02a63e MFC r258854:
Fix PKG_ABI detection in bsdconfig(8) after pkg-1.2 is released, since
  the format of 'pkg -vv' output has changed.

Approved by:	re (hrs)
Sponsored by:	The FreeBSD Foundation
2013-12-05 01:06:05 +00:00
gjb
190b91ee4b MFC r258786, r258796, r258797, r258847, r258853, r258949:
r258786:
  Move OPTIONS_UNSET outside of the PBUILD_FLAGS variable, otherwise
  the textproc/docproj port build fails.

r258796 (hrs):
  - Prevent TARGET and TARGET_ARCH from being defined as empty when
    TARGET="" and/or TARGET_ARCH="" is specified.
  - Remove extra ().

r258797 (hrs):
  Use standard CLEANFILES/CLEANDIRS and clean target in bsd.obj.mk.

r258847:
  Provide reproducibility between builds by building pkg(8) from ports,
  instead of using pkg-bootstrap.

  This should resolve a problem that was discovered during 10.0-BETA4
  freebsd-update(8) builds,

r258853:
  Turn off the dvdrom target by default.  dvd1.iso is now built by
  specifying 'WITH_DVD=1' during 'make release'.

  This caused some problems during the freebsd-update builds for
  10.0-BETA4.

r258949:
  Ensure WITH_DVD is not empty to prevent 'WITH_DVD= ' from evaluating
  to true.

Approved by:	re (hrs)
Sponsored by:	The FreeBSD Foundation
2013-12-05 00:59:29 +00:00
peter
9b21716e78 MFC: r258718: fix emulated jail_v0 byte order
Approved by:	re (gjb)
2013-12-04 18:25:04 +00:00
mav
d0d1c645c4 MFC r258495:
Update description of logical CPU handling in the latest releases and
remove obsolete sysctl variable machdep.hlt_logical_cpus.

Approved by:	re (hrs)
2013-12-04 10:54:23 +00:00
trasz
80dc28ceef MFC r258790:
Fix hang on reboot with active iSCSI connections.

Approved by:	re (glebius)
Sponsored by:	The FreeBSD Foundation
2013-12-04 09:46:27 +00:00
rodrigc
a19b1d3a58 MFC 258591
In vnet_route_uninit(), free some memory that is allocated in vnet_route_init().

To reproduce the problem:
  (1)  Take a GENERIC kernel config, and add options for: VIMAGE, WITNESS,
       INVARIANTS.
  (2)  Run this command in a loop:
       jail -l -u root -c path=/ name=foo persist vnet && jexec foo ifconfig lo0 127.0.0.1/8 && jail -r foo

       see: http://lists.freebsd.org/pipermail/freebsd-current/2010-November/021280.html
            http://lists.freebsd.org/pipermail/freebsd-current/2010-November/021291.html

This doesn't eliminate all the "Freed UMA keg was not empty" warning messages
on the console, but it helps.

Approved by: re (gjb)
2013-12-04 07:55:49 +00:00
rodrigc
85a1f61056 MFC r258588
In sys/netpfil/ipfw/ip_fw_nat.c:vnet_ipfw_nat_uninit() we call "IPFW_WLOCK(chain);".
This lock gets deleted in sys/netpfil/ipfw/ip_fw2.c:vnet_ipfw_uninit().

Therefore, vnet_ipfw_nat_uninit() *must* be called before vnet_ipfw_uninit(),
but this doesn't always happen, because the VNET_SYSINIT order is the same for both functions.
In sys/net/netpfil/ipfw/ip_fw2.c and sys/net/netpfil/ipfw/ip_fw_nat.c,
IPFW_SI_SUB_FIREWALL == IPFW_NAT_SI_SUB_FIREWALL == SI_SUB_PROTO_IFATTACHDOMAIN
and
IPFW_MODULE_ORDER == IPFW_NAT_MODULE_ORDER

Consequently, if VIMAGE is enabled, and jails are created and destroyed,
the system sometimes crashes, because we are trying to use a deleted lock.

To reproduce the problem:
  (1)  Take a GENERIC kernel config, and add options for: VIMAGE, WITNESS,
       INVARIANTS.
  (2)  Run this command in a loop:
       jail -l -u root -c path=/ name=foo persist vnet && jexec foo ifconfig lo0 127.0.0.1/8 && jail -r foo

       (see http://lists.freebsd.org/pipermail/freebsd-current/2010-November/021280.html )

Fix the problem by increasing the value of IPFW_NAT_SI_SUB_FIREWALL,
so that vnet_ipfw_nat_uninit() runs after vnet_ipfw_uninit().

Approved by: re (gjb)
2013-12-04 07:50:18 +00:00
rodrigc
84898ef06b MFC r258737
In keg_dtor(), print out the keg name in the "Freed UMA keg was not empty"
message printed to the console.  This makes it easier to track down
the source of certain memory leaks.

Suggested by: adrian
Approved by: re (gjb)
2013-12-04 07:46:53 +00:00
rodrigc
9dd37e2e68 MFC r258738
Also mention that drill(1) can be used, now that nslookup and dig are no
longer in the base system.

Suggested by: peter
Approved by: re (gjb)
2013-12-04 07:45:08 +00:00
tuexen
cfa2934865 MFC r258574:
Only initialize some mutexes for the default VNET.

In r208160, sctp_it_ctl was made a global variable, across all VNETs.
However, sctp_init() is called for every VNET that is created.  This results
in the same global mutexes which are part of sctp_it_ctl being initialized.  This can result
in crashes if many jails are created.

To reproduce the problem:
  (1)  Take a GENERIC kernel config, and add options for: VIMAGE, WITNESS,
       INVARIANTS.
  (2)  Run this command in a loop:
       jail -l -u root -c path=/ name=foo persist vnet && jexec foo ifconfig lo0 127.0.0.1/8 && jail -r foo

       (see http://lists.freebsd.org/pipermail/freebsd-current/2010-November/021280.html )

Witness will warn about the same mutex being initialized.

Fix the problem by only initializing these mutexes in the default VNET.

MFC r258765:

In
http://svnweb.freebsd.org/changeset/base/258221
I introduced a bug which initialized global locks
whenever the SCTP stack initialized. This was fixed in
http://svnweb.freebsd.org/changeset/base/258574
by rodrigc@. He just initialized the locks for
the default vnet. This fix reverts to the old
behaviour before r258221, which explicitly makes
sure it is only called once, because this works also on
other platforms.

Approved by: re@ (gjb)
2013-12-03 20:55:37 +00:00
kib
34987b9cca MFC r258663:
Use sysctl KERN_PROC_SIGTRAMP to retrieve the signal trampoline
location for the native amd64 ABI.  This fixes unwinding over the
signal frame after trampoline was moved to the shared page.

Approved by:	re (gjb)
2013-12-03 19:42:46 +00:00
kib
9934b5683d MFC r258660:
Fix sys/sysctl.h use for cc -m32 on amd64.

Approved by:	re (gjb)
2013-12-03 19:41:48 +00:00
kib
b3b0fb1cda MFC r258661:
Add sysctl KERN_PROC_SIGTRAMP to retrieve signal trampoline location for the
given process.

Approved by:	re (gjb)
2013-12-03 19:40:32 +00:00
trasz
fd6f73d3a2 MFC r258043:
Fix typo.

Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2013-12-03 18:35:17 +00:00