Commit Graph

182609 Commits

Author SHA1 Message Date
Jim Harris
38441bd9a9 Add message when nvd disks are attached and detached.
As part of this commit, add an nvme_strvis() function which borrows
heavily from cam_strvis().  This will allow stripping of
leading/trailing whitespace and also handle unprintable characters
in model/serial numbers.  This function goes into a new nvme_util.c
file which is used by both the driver and nvmecontrol.

Sponsored by:	Intel
Reviewed by:	carl
MFC after:	3 days
2013-07-19 21:40:57 +00:00
Jack F Vogel
428e286da3 Add new Coleto Creek device support: SATA, SMBus, and Watchdog devices.
MFC after: 1 week
2013-07-19 21:37:40 +00:00
Jim Harris
2fb37e8f1a Fix nvme(4) and nvd(4) to support non 512-byte sector sizes.
Recent testing with QEMU that has variable sector size support for
NVMe uncovered some of these issues.  Chatham prototype boards supported
only 512 byte sectors.

Sponsored by:	Intel
Reviewed by:	carl
MFC after:	3 days
2013-07-19 21:33:24 +00:00
Jim Harris
c3e9dd893b Do not call disk_create() until we have completed all initialization of our
internal disk structure.

Sponsored by:	Intel
Reviewed by:	carl
MFC after:	3 days
2013-07-19 21:30:53 +00:00
Michael Tuexen
da24cfcb35 Get the code compiling without INET and INET6 being defined.
This is not possible in FreeBSD, but in the upstream code.

MFC after: 2 weeks
2013-07-19 21:16:59 +00:00
John Baldwin
ff74a3fa6b Be more aggressive in using superpages in all mappings of objects:
- Add a new address space allocation method (VMFS_OPTIMAL_SPACE) for
  vm_map_find() that will try to alter the alignment of a mapping to match
  any existing superpage mappings of the object being mapped.  If no
  suitable address range is found with the necessary alignment,
  vm_map_find() will fall back to using the simple first-fit strategy
  (VMFS_ANY_SPACE).
- Change mmap() without MAP_FIXED, shmat(), and the GEM mapping ioctl to
  use VMFS_OPTIMAL_SPACE instead of VMFS_ANY_SPACE.

Reviewed by:	alc (earlier version)
MFC after:	2 weeks
2013-07-19 19:06:15 +00:00
Scott Long
748e404f26 Since there's no defined schema for the XML that's generated by the
kern.geom.confxml sysctl, it's silly to warn about tags in libgeom,
especially since libgeom exists simply to build a tree out of the conf
information.

Obtained from:	Netflix
MFC after:	3 days
2013-07-19 06:42:15 +00:00
Ed Maste
750288f343 Correct ELF note decoding for non-core files
Requested by:	kib
2013-07-19 01:04:17 +00:00
Scott Long
1610f95c56 Overhaul error, information, and debug logging.
Obtained from:	Netflix
MFC after:	3 days
2013-07-19 00:12:41 +00:00
Jim Harris
dddb618e3f Use _PATH_DEV (from paths.h) for the "/dev/" string, rather than
hard-coding it.

Sponsored by:	Intel
Suggested by:	kib
Reviewed by:	kib, carl
MFC after:	3 days
2013-07-18 23:25:57 +00:00
Jim Harris
b378da2781 Simplify open_dev() by returning errno values rather than just 0 or 1.
Also remove stat() call and just rely on errno from open() call to discern
whether dev node exists or not.

Sponsored by:	Intel
Reviewed by:	kib, carl
MFC after:	3 days
2013-07-18 23:12:44 +00:00
Pawel Jakub Dawidek
de89bd6bc2 Close uniq(1) in the capability mode sandbox and limit descriptors using
capability rights.
2013-07-18 22:11:27 +00:00
Pawel Jakub Dawidek
e14da991ec - Make localtime(3) to work in sandbox.
- Move strerror(3) initialization to its own function.
2013-07-18 21:56:10 +00:00
Jung-uk Kim
43a716a640 Decode PCIe ASPM capability and status. 2013-07-18 20:59:58 +00:00
Ed Maste
9be99d951b Correct alignment in note output 2013-07-18 20:36:21 +00:00
Ed Maste
4e7a9c2e6f Remove accidentally cut-and-pasted colons 2013-07-18 19:17:58 +00:00
Peter Grehan
8b271170d1 Sanity-check the vm exitcode, and exit the process if it's out-of-bounds
or there is no registered handler.

Submitted by:	Bela Lubkin   bela dot lubkin at tidalscale dot com
2013-07-18 18:40:54 +00:00
Ed Maste
c158e13f7d Handle FreeBSD-specific ELF notes
Add a function to return the specific type, when the note's Name field is
'FreeBSD'.

r249558 added FreeBSD-specific ELF note types that reuse type numbers of
existing generic / Linux types.  This caused 'readelf -n' to produce
incorrect output on FreeBSD core files.

Sponsored by:	DARPA, AFRL
MFC after:	3 days
2013-07-18 17:25:50 +00:00
John Baldwin
c825d4dc50 Properly handle I/O windows in bridges with the ISA enable bit set. These
beasts still exist unfortunately.  More details can be found in other
references, but the short version is that bridges with this bit set ignore
I/O port ranges that alias to valid ISA I/O port ranges.  In the driver
this requires not allocating these alias regions from the parent device
(so they are free to be acquired by ISA devices), and ensuring no child
devices use resources from these alias regions.
- Change the pcib_window structure to allow for an array of backing
  resources rather than a single resource and update the existing code
  to cope with this.  Some of the coping requires using the saved
  base and limit values in pcib_window instead of using rman operations
  on the backing resource.
- Add special handling for allocating and adjusting the I/O port window
  of an ISA-enabled bridge to only allocate the non-alias ranges and
  add those to the associated resource manager.
- Reject I/O port allocations for a fixed request that conflicts with an
  ISA alias range.
- Remove the "no prefected decode" verbose printf during boot.  The absence
  of a "prefetched decode" line is sufficient.
- Replace the "subtractively decoded bridge" verbose printf with a single
  printf that lists all the "special" decoding modes of a bridge: ISA,
  subtractive, and VGA.
- Add a custom bus_release_resource() method to the PCI bus driver so that
  it can properly free resources for I/O windows of PCI-PCI bridges.
  (These resources are not stored in the bridge device's resource list.)

PR:		misc/179033
MFC after:	2 weeks
2013-07-18 15:17:11 +00:00
John Baldwin
c232b2aebb Rework the previous fix for the IB vs Ethernet sysctl handler to be more
generic and apply to all sysfs attributes:
- Use sysctl_handle_string() instead of reimplementing it.
- Remove trailing newline from the current value before passing it to
  userland and append a newline to the new string value before passing it
  to the attribute's store function.
- Don't leak the temporary buffer if the first error check triggers.
- Revert earlier change to mlx4 port mode handler.

PR:		kern/174213
Submitted by:	Garrett Cooper
Reviewed by:	Shakar Klein @ Mellanox
MFC after:	1 week
2013-07-18 14:06:01 +00:00
Kevin Lo
e32234295d Include stdint.h when use intmax_t.
Reported by:	bde
2013-07-18 06:32:19 +00:00
Joel Dahl
050da67038 Minor mdoc fixes. 2013-07-18 05:46:33 +00:00
Hiroki Sato
1c26ccaba0 - Fix a bug in ipv6_prefix_IF. It did not work with the 64-bit prefix
notation like 2001:db8:1:1.

- Use eui64 flag in ifconfig(8) instead of network6_getladdr()[*] for
  interface indentifier part.

Suggested by:	ume [*]
MFC after:	3 days
2013-07-18 02:58:24 +00:00
Hiroki Sato
8207f478fc Fix a gcc warning.
Pointy hat to:	hrs
2013-07-18 02:34:25 +00:00
Kevin Lo
8ea4debe59 Replace PRId64 with "jd" in a printf call. Cast the corresponding value to
intmax_t, because the original type is off_t.

Reported by:	bde
2013-07-18 01:40:31 +00:00
Xin LI
c92bc5e996 Manually merge part of vendor import r238583 from Illumos.
Illumos changeset: 13680:2bd022a765e2
Illumos ZFS issue:

    2671 zpool import should not fail if vdev ashift has increased

MFC after:	3 days
2013-07-18 00:22:42 +00:00
Peter Grehan
ba41c3c13f Major rework of the virtio code. Split out common parts, and modify
the net/block devices accordingly.

Submitted by:	Chris Torek   torek at torek dot net
Reviewed by:	grehan
2013-07-17 23:37:33 +00:00
Jung-uk Kim
ba53f0d5ca Reload font when syscons(4) is resuming without switching mode.
Reported by:	adrian (more than a year ago)
Prodded by:	adrian (less than a month ago)
2013-07-17 23:29:56 +00:00
Jim Harris
8e0ac13f5a Use pause() instead of DELAY() when polling for completion of admin
commands during controller initialization.

DELAY() does not work here during config_intrhook context - we need to
explicitly relinquish the CPU for the admin command completion to
get processed.

Sponsored by:	Intel
Reported by:	Adam Brooks <adam.j.brooks@intel.com>
Reviewed by:	carl
MFC after:	3 days
2013-07-17 23:26:56 +00:00
Jim Harris
e8f25c6266 Define constants for the lengths of the serial number, model number
and firmware revision in the controller's identify structure.

Also modify consumers of these fields to ensure they only use the
specified number of bytes for their respective fields.

Sponsored by:	Intel
Reviewed by:	carl
MFC after:	3 days
2013-07-17 23:23:38 +00:00
Jim Harris
a648fac32d Always initialize fd to 0 in open_dev().
Sponsored by:	Intel
Reviewed by:	carl
MFC after:	3 days
2013-07-17 23:14:41 +00:00
Jim Harris
a073133cdf Add bus_dmamap_load_bio and bus_dmamap_load_ccb to bus_dma(9).
Sponsored by:	Intel
Reviewed by:	kib
MFC after:	3 days
2013-07-17 19:41:16 +00:00
Craig Rodrigues
0d6422dd87 In this GRN, Marcel Moolenaar overhauled the logic for mounting
the root file system on bootup:

   |------------------------------------------------------------------------
   |r214006 | marcel | 2010-10-17 22:01:53 -0700 (Sun, 17 Oct 2010) | 20 lines
   |
   | Re-implement the root mount logic using a recursive approach, whereby each
   |root file system (starting with devfs and a synthesized configuration) can
   |contain directives for mounting another file system as root.
   |------------------------------------------------------------------------

This commit adds a mount.conf(8) man page which documents
the root mount logic.  mount.conf(8) also provides some examples
for the /.mount.conf file, which can be used to change the root mount behavior.

Reviewed by: marcel bjk
2013-07-17 19:32:07 +00:00
Hiroki Sato
171863ac75 Use NET_RT_DUMP.0.FIB leaf node instead of setting td_proc->p_fibnum. 2013-07-17 14:15:00 +00:00
Hiroki Sato
826b6d6978 - Add support of MK_INET_SUPPORT=no.
- Fix a bug in sodump() which prevented struct sockaddr_in6 from displaying.
- Fix a bug in in fiboptlist_csv() which could cause free() of uninitialized
  pointer.
- Style cleanups:
 . Add missing "static" keywords.
 . Use an array of struct sockaddr_storage instead of sockunion for rtmsg.
 . Use err() and errx() instead of pair of fprintf(stderr, "...") + exit(1).
 . Use nitems() macro.
 . Various style(9) fixes.
2013-07-17 14:05:20 +00:00
Baptiste Daroussin
d06990ae3d Do not overwrite the new UTF-8 files with the old ISO one 2013-07-17 14:00:51 +00:00
Hiroki Sato
0365230a1a Simplify keywords.h generation. 2013-07-17 13:47:13 +00:00
John Baldwin
d356583dbc Remove check forbidding requests that would result in one port being set
to Ethernet and the subsequent port being set to IB.

Submitted by:	Shakar Klein @ Mellanox
Tested by:	Morgan Robertson <morganrobertson@gmail.com>
MFC after:	1 week
2013-07-17 13:41:54 +00:00
Gleb Smirnoff
60bd643435 Fix typo.
Submitted by:	ae
2013-07-17 13:13:44 +00:00
Gleb Smirnoff
9fd7a1b3dd Improve example, so that it doesn't dump core when example module
isn't loaded.
2013-07-17 12:28:48 +00:00
Baptiste Daroussin
b13ce70710 Change Eu to the proper UTF-8 symbol this was missed in r253414 2013-07-17 11:51:24 +00:00
Konstantin Belousov
a8b0523ae7 Clear the vnode knotes before destroying vpollinfo.
Reported and tested by:	Patrick Lamaiziere <patfbsd@davenulle.org>
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2013-07-17 10:56:21 +00:00
Baptiste Daroussin
e4f0cdc73f For all european contries using the euro currency, add an UTF-8 definition with the proper Euro symbol
MFC after:	1 week
2013-07-17 10:12:31 +00:00
Andriy Gapon
22423fd8a0 [fix to r253380] __setenv: be explicit about placing '=' after name
This should a regression introduced in r253380 if malloc'ed memory
happens to have '=' at the right place.

Reported by:	ache
Pointyhat to:	me (avg)
MFC after:	1 day
X-MFC with:	r253380
2013-07-17 08:45:27 +00:00
Pyun YongHyeon
29b44b096f Implement workaround for BCM5719/BCM5720 TX hang.
The read DMA request logic operation is based on having sufficient
available space in the transmit data buffer (TXMBUF) before a read
DMA can be requested.  There are four read DMA channels that use
the TXMBUF, and the logic checks if the available free space in the
TXMBUF is large enough for all the data in the four Send Buffers
for which buffer descriptors have been fetched.  The Enable_Request
signal is asserted only if the free TXMBUF space is larger than the
sum of the four DMA length registers.  The power-up default value
of BGE_RDMA_LSO_CRPTEN_CTRL register bit 25 (bit 21 on BCM5720) is
zero, which selects the DMA length registers to connect to the
input of the adder block.  The DMA length registers are
asynchronously reset following BCM5719/BCM5720 power-up, and due to
the lack of synchronous deassertion of the length registers reset
signal these resisters may contain uninitialized values following
the reset deassertion.
In the case of the failure the uninitialized DMA length register
values added up to more than the TXMBUF size, which prevented the
assertion of the Enable_Request signal and any subsequent read DMA
to start.  This lockup condition is the root cause of failing to
generate any transmit traffic.

To workaround the issue, select alternate output of multiplexers
and transmit the first four Ethernet frames. This overwrites the
DMA length registers with valid values.

Reported by:	Geans Pin <geanspin@broadcom.com>
Reviewed by:	Geans Pin <geanspin@broadcom.com>
2013-07-17 04:53:53 +00:00
Navdeep Parhar
92ad6ac7d4 Specify a timeout for the PL block.
MFC after:	3 days
2013-07-17 02:37:40 +00:00
Pyun YongHyeon
fcb1bf4153 Avoid magic constant.
No functional change.
2013-07-17 01:34:25 +00:00
Pyun YongHyeon
b9a17c6ce4 o TxD ring requires 8 bytes alignment to work so change alignment
constraint to 8. Previously it may have triggered watchdog
   timeouts.
 o Check whether interrupt is ours or not.
 o Enable interrupts before attemping to transmit queued packets.
   This will slightly improve TX performance.
 o No need to clear IFF_DRV_OACTIVE in a loop. AE_FLAG_TXAVAIL is
   used to know whether there are enough available TxD ring space.
 o Added missing bus_dmamap_sync(9) in ae_rx_intr() and rearranged
   code to avoid unncessary register access.
 o Make sure to clear TxD, TxS, RxD rings in driver initialization.
   Otherwise some data in these rings could be interpreted as
   'updated' which in turn will advance internally maintained
   pointers and can trigger watchdog timeouts.

PR:	kern/180382
2013-07-17 01:24:23 +00:00
Kevin Lo
2f31c8f52e Add missing headers. 2013-07-17 00:58:23 +00:00
Kevin Lo
1d35db811f Use PRId64 instead of %gd to print an int64_t. 2013-07-17 00:54:21 +00:00