Commit Graph

201614 Commits

Author SHA1 Message Date
arybchik
b7871cb668 MFC r293902
sfxge: cleanup: quieten efx_mcdi_read_resonse_header error reporting

The "mcdi_err_arg" probe still reports results of failed MCDI
commands, unless the caller invoked efx_mcdi_execute_quiet().

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-01-20 08:02:11 +00:00
arybchik
95a756ad4d MFC r293901,r294371
sfxge: add accessors for license-related MCDI calls to common code

Add support for Huntington MCDI licensing interface to common code.
Ported from Linux net driver IOCTL functions with restructuring for
initial support for V3 licensing API.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-01-20 08:01:21 +00:00
arybchik
bbc583eeb0 MFC r293900
sfxge: add table entries for License NVRAM partition

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-01-20 07:59:04 +00:00
arybchik
4b9f4885a9 MFC r293899
sfxge: cleanup: adjust efx_mcdi_get_port_modes() comment for clarity

Fix an explanatory comment which did not explain very well.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-01-20 07:57:18 +00:00
arybchik
59fb3e0b1e MFC r293895
sfxge: fix common code VPD iterator and duplicate tag verification

Fix efx_vpd_hunk_next() which has -- since its inception -- failed to
correctly iterate over the tags and keywords contained in the VPD data.
Only the first tag or keyword would be returned and the next call with
*contp == 1 would walk to the end of the data and finish.

This was spotted when fixing up errors spotted by Prefast code analysis
(which neglected to set all of the out parameters in all successful cases)

Also fix efx_vpd_verify() on Siena and EF10 which (as a side effect of
correctly iterating over all the tags and keywords) was failing as it
detected that both the static VPD and dynamic VPD storage contained an
RV keyword in the VPD-R tag.  This is intentional as the static VPD and
dynamic VPD are stored separately (firmware merges their contents and
computes a new RV keyword checksum for the data readable from the VPD
capability in PCIe configuration space).

Submitted by:   Andrew Lee <alee at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-01-20 07:53:26 +00:00
arybchik
9d665fc54f MFC r293892
sfxge: use correct register definitions for setting interrupt moderation on Medford

The only value which has changed is the number of rows
(ER_DZ_EVQ_TMR_REG_ROWS is 2048 vs 1024 for FR_BZ_TIMER_COMMAND_REGP0_ROWS)
but that isn't used, so this shouldn't change behaviour.

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-01-20 07:52:24 +00:00
arybchik
aeca94898e MFC r293891
sfxge: support FATSOv2 in common code

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-01-20 07:51:23 +00:00
arybchik
fa1d117e18 MFC r293890
sfxge: rx_prefix_pktlen methods do not require EFSYS_OPT_RX_SCALE

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-01-20 07:50:00 +00:00
arybchik
13a2c477eb MFC r293889,r294080,r294093,r294201,r294249-r294252
sfxge: convert nvram methods to use partition id

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-20 07:48:49 +00:00
arybchik
d19037575e MFC r293888
sfxge: rework MCDI start request

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-01-20 07:44:05 +00:00
arybchik
f7859a7f29 MFC r293887
sfxge: add Medford NIC methods

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2016-01-20 07:42:31 +00:00
jhb
24f353ebf7 Regen for r294368. 2016-01-20 01:11:01 +00:00
jhb
77733541d4 MFC 289769,289822,290143,290144:
Rename remaining linux32 symbols from linux_* to linux32_*.

289769:
Rename remaining linux32 symbols such as linux_sysent[] and
linux_syscallnames[] from linux_* to linux32_* to avoid conflicts with
linux64.ko.  While here, add support for linux64 binaries to systrace.
- Update NOPROTO entries in amd64/linux/syscalls.master to match the
  main table to fix systrace build.
- Add a special case for union l_semun arguments to the systrace
  generation.
- The systrace_linux32 module now only builds the systrace_linux32.ko.
  module on amd64.
- Add a new systrace_linux module that builds on both i386 and amd64.
  For i386 it builds the existing systrace_linux.ko.  For amd64 it
  builds a systrace_linux.ko for 64-bit binaries.

289822:
Fix build for the KTR-enabled kernels.

290143:
Fix build with DEBUG defined.

290144:
Update for LINUX32 rename.  The assembler didn't complain about undefined
symbols but just used 0 after the rename.
2016-01-20 01:09:53 +00:00
ian
2651e6b1c6 MFC r292337, r292552, r292553:
Build mount_smbfs for arm.  Also sort the subdirs.

  Avoid unaligned memory accesses when encoding netbios names in libsmb.

  The current code for encoding a netbios name converts each byte to a 16-bit
  value and stores the result by casting a char* to u_short*, resulting in
  alignment faults on strict-alignment platforms.

  This change reimplements the encoding routine using only byte accesses to
  memory. There is no particular reason to work with 16-bit values just
  because the encoding process creates two bytes of output for every byte of
  input. Working a byte at at time also avoids endian problems for big-endian
  platforms.

  Make the building of libsmb and mount_smbfs unconditional, now that r292552
  has eliminated alignment and endian problems that were making it fail on
  some platforms.

PR:           180438
PR:           189415
Relnotes:	Yes
2016-01-19 23:36:49 +00:00
ngie
223081e0c8 Default __MAKE_SHELL to /bin/sh when generating aton_ether_subr.c via
`gen_ether_subr`.

__MAKE_SHELL is only defined when installworld is run on stable/10,
which breaks workflows dealing with source trees mounted with noexec [*]

This is a direct commit to stable/10

Reported by: Mark Martinec <Mark.Martinec+freebsd@ijs.si>
Sponsored by: EMC / Isilon Storage Division
2016-01-19 23:18:49 +00:00
ian
73c42f454f MFC r292888:
Fix the error checking for the ubenv command.  This moves the check for an
  empty ldvar (which amounts to the varname string starting with '=') into
  the if block that manipulates ldvar, which avoids later referencing ldvar
  when it was never initialized.
2016-01-19 21:42:19 +00:00
ian
3c5bf8f9ae MFC r292584:
Set env vars from values on the efi loader command line.

  Examine each cmdline arg and if it contains an '=' convert it to ascii and
  pass it to putenv(). This allows var=value settings to come in on the
  command line.

  This will allow overriding dhcp server-provided data in loader(8), as
  discussed in PR 202098

PR:           202098
Relnotes:	Yes (this goes together with r294343)
2016-01-19 21:39:21 +00:00
ian
8d32f22531 MFC r292583:
Allow dhcp/bootp server-provided values to be overriden from environment
  variables in loader(8) and other libstand applications.

  Sometimes a dhcp server provides incorrect information along with the IP
  address. It would be useful to have a way to override this with
  locally-supplied information, such as command line parameters passed from a
  prior-stage bootloader. This change allows pre-existing env vars to take
  precedence over values delivered by the dhcp or bootp server.

  The bootp/dhcp code in libstand automatically creates environment variables
  from the data provided by the server (dhcp.root-path, dhcp.domain-name,
  etc). It also transcribes the values to some global variables such as
  'rootpath' and 'hostname'.

  This change does two things:

      When adding dhcp.* vars to the environment, don't replace existing
      vars/values.

      When setting the global vars rootpath and hostname, use the
      dhcp.root-path and dhcp.host-name env var values if they exist.

  This allows the platform-specific part of loader(8) to obtain override
  values in some platform-specific way and store them in the environment
  before opening the network device. The set of values that can be overriden
  is currently limited to just string options. The values that are delivered
  as binary data are things that probably shouldn't be overridden (IP,
  netmask, gateway, etc).

  The original patch this evolved from was submitted by martymac@

PR:           202098
Relnotes:	Yes
2016-01-19 21:35:09 +00:00
ian
f2c0efd7de MFC r292234, r292527:
Add strlcat() and strlcpy() to libstand and libstand32.
2016-01-19 21:27:25 +00:00
ian
c6f06f22fc MFC r291164, r291876, r292227:
Print more detailed info about the disk and partition chosen for booting.
  No behavioral changes, just cosmetics.

  Remove stray unescaped `%` in `Booting from ...` informational message.

  Enhance the "ubenv import" command to allow importing a u-boot env var
  directly into a loader (and thus kernel) env var.
2016-01-19 21:21:59 +00:00
jhb
86ab8db358 MFC 292669:
Add accessor methods to fetch the BAR holding the MSI-X table and PBA.

While here, explicitly note the requirement that the BAR(s) must be
allocated prior to calling pci_alloc_msix().
2016-01-19 21:08:31 +00:00
jhb
8aa68d7858 MFC 292410,292443,293977:
Exit cleanly if malloc() fails to allocate a buffer for a copy of the
current MBR.

PR:		205322
Submitted by:	Alexander Kuleshov <kuleshovmail@gmail.com>
2016-01-19 19:04:56 +00:00
dim
0458c393d2 MFC r294102:
MFV r294101: 6527 Possible access beyond end of string in zpool comment

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Gordon Ross <gwr@nexenta.com>

illumos/illumos-gate@2bd7a8d078

This fixes erroneous double increments of the 'check' variable in a loop
in spa_prop_validate().  I ran into this in the clang380-import branch,
where clang 3.8.0 warns about it.  (It is already fixed there.)
2016-01-19 18:35:22 +00:00
ngie
1a7affd5e6 MFC r294128:
Fix -Wunused warning with clang/gcc

- Get rid of unused argc/argv variables in main
- Bump WARNS to 6
2016-01-19 01:41:19 +00:00
ngie
30ae8fa920 MFC r294103:
- Check for accf_filter before running the tests, otherwise it will always
  fail at subtest 9/11
- Use strncpy instead of strcpy with afa.af_name
2016-01-19 01:38:06 +00:00
ngie
4b07dd5aab MFC r294123:
Add missing newline to message about requiring root privileges

This will help ensure that scripts/parsers don't get confused when the message
is printed out
2016-01-19 01:35:16 +00:00
ngie
95e3008df9 MFC r293715:
Fix a mismerge from NetBSD in r162194 with `xdr_rpcb_entry_list_ptr(..)`

This fixes the potential NULL pointer dereference properly, and also fixes
memory leaks encountered in the process of iterating through `*rp`.

Found by: Valgrind
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
2016-01-19 01:30:22 +00:00
gnn
ba5e3d1893 MFC: 293459,293643
Add netmap support for bhyve
2016-01-18 21:24:28 +00:00
jhb
93e78d3449 MFC 292409:
It seems certain Intel GPUs use GPIO bitbanging over a child device
instead of GMBUS access for I2C transfers.  The GMBUS driver falls back
to this mode when a transfer times out.  However, the first transfer to
timeout was sending the request back to itself resulting in an panic due
to recursing on a lock.  Fix it to forward the request on to the proper
device.  This appears to have been accidentally changed in r277487.
2016-01-18 20:44:29 +00:00
jhb
e8ea29ce3a MFC 291225:
Add a new -B flag for use with list mode (-l) that lists details about
bridges.  Currently this includes information about what resources a
bridge decodes on the upstream side for use by downstream devices including
bus numbers, I/O port resources, and memory resources.  Windows and bus
ranges are enumerated for both PCI-PCI bridges and PCI-CardBus bridges.

To simplify the implementation, all enumeration is done by reading the
appropriate config space registers directly rather than querying the
bridge driver in the kernel via new ioctls.  This does result in a few
limitations.

First, an unimplemented window in a PCI-PCI bridge cannot be accurately
detected as accurate detection requires writing to the window base
register.  That is not safe for pciconf(8).  Instead, this assumes that
any window where both the base and limit read as all zeroes is
unimplemented.

Second, the PCI-PCI bridge driver in a tree has a few quirks for
PCI-PCI bridges that use subtractive decoding but do not indicate that
via the progif config register.  The list of quirks is duplicated in
pciconf's source.
2016-01-18 19:52:20 +00:00
delphij
2a668e7e33 MFC r288303: MFV r288243: nc from OpenBSD 5.8. 2016-01-18 19:42:05 +00:00
delphij
fa1e90c82b MFC r293190: MFV r293125: less v481.
Relnotes:	yes
2016-01-18 19:13:54 +00:00
tuexen
119cebf8a0 MFC r289873:
Add support to systat to display SCTP statistics.
MFC r289874:
Bump date in man page.
2016-01-18 18:50:26 +00:00
jhb
e6d9c6386f MFC 290728:
Export various helper variables describing the layout and size of
certain kernel structures for use by debuggers. This mostly aids
in examining cores from a kernel without debug symbols as a debugger
can infer these values if debug symbols are available.

One set of variables describes the layout of 'struct linker_file' to
walk the list of loaded kernel modules.

A second set of variables describes the layout of 'struct proc' and
'struct thread' to walk the list of processes in the kernel and the
threads in each process.

The 'pcb_size' variable is used to index into the stoppcbs[] array.

The 'vm_maxuser_address' is used to distinguish kernel virtual addresses
from user addresses. This doesn't have to be perfect, and
'vm_maxuser_address' is a cheap and simple way to differentiate kernel
pointers from simple values like TIDs and PIDs.

While here, annotate the fields in struct pcb used by kgdb on amd64
and i386 to note that their ABI should be preserved.  Annotations for
other platforms will be added in the future.
2016-01-18 18:27:21 +00:00
asomers
628004b785 MFC r292573
Fix "mount -a" for NFS and ZFS filesystems with shared mountpoints

sbin/mount.c
	Check whether an fstab entry has the same fstype as a mounted
	filesystem before declaring it to be mounted. This will allow NFS
	filesystems that share a mountpoint with a local filesystem to be
	automatically mounted at boot.

	This is not such an unusual situation. For example, if somebody uses
	the standard installer with a ZFS root, he'll get a /usr/home
	filesystem, even though he may choose to mount /usr/home over NFS.
2016-01-18 16:41:26 +00:00
emaste
6a718e8227 MFC r281058: Remove whitespace. 2016-01-18 16:09:58 +00:00
emaste
afae46b0e1 MFC r293244: Introduce and use new EFI_ERROR_CODE macro for EFI errors 2016-01-18 15:55:25 +00:00
emaste
800cde159e MFC r293343: Move amd64 metadata.h to x86 and share with i386 2016-01-18 15:52:07 +00:00
emaste
31c7f199a4 MFC r281381: Use explicitly sized types in EFI module metadata
This will allow the same metadata struct to be used on all platforms.
2016-01-18 15:43:00 +00:00
pfg
e7a4f4fac2 MFC r293680
ext4: add support for reading sparse files

Add support for sparse files in ext4. Also implement read-ahead, which
greatly increases the performance when transferring files from ext4.
The sparse file support has become very common in ext4.

Both features implemented by Damjan Jovanovic.

PR:		205816
2016-01-18 15:39:32 +00:00
emaste
51120efe07 MFC r293165: loader.efi: support non-contiguous console modes 2016-01-18 15:37:41 +00:00
emaste
4c01df8942 MFC r281117: Move boot1.efi to the global CLEANFILES list
It's not x86 specific.
2016-01-18 15:34:10 +00:00
emaste
1be9b7c51a MFC r287930: Various small cleanups to EFI loader Makefiles. 2016-01-18 15:30:15 +00:00
ae
357c6ab5c1 MFC r293679:
Change the type of newsize argument in the smbfs_smb_setfsize() function
  from int to int64.
  MSDN says that SMB_SET_FILE_END_OF_FILE_INFO uses signed 64-bit integer
  to specify offset, but since smbfs_smb_setfsize() has used plain int,
  a value was truncated in case when offset was larger than 2G.
  	https://msdn.microsoft.com/en-us/library/ff469975.aspx

  In particular, now `truncate -s 10G` will work correctly on the mounted
  SMB share.
2016-01-18 11:47:03 +00:00
ngie
f4e3dd9ef2 Remove tools/regression/lib/msun (follow up to r292497)
Sponsored by: EMC / Isilon Storage Division
2016-01-18 03:56:49 +00:00
ngie
2af193e575 MFC r292497:
Integrate the remaining tools/regression/lib/msun testcases into the
FreeBSD test suite under lib/msun/tests
2016-01-18 03:55:40 +00:00
ngie
6391e71761 MFC r293705:
Similar to r293704, fix theoretical leak of netconfig(3) resources in
__rpcbind_is_up(..) if getnetconfig(3) is partly successful in allocating
resources, but not completely successful by moving the endnetconfig(3) call
up before we return from the function if nconf == NULL.

Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
2016-01-18 03:49:57 +00:00
ngie
2e97bc7968 MFC r293704:
Fix theoretical leak of netconfig(3) resources in svcunix_create(..)

In the event that the getconfig(3) call in svcunix_create is partly successful,
some of the netconfig(3) resources allocated might be leaked if the call returns
NULL as endnetconfig(3) wasn't called explicitly in that case. Ensure that the
resources are fully cleaned up by going to the `done` label, which will call
endnetconfig(3) for us.

Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
2016-01-18 03:47:46 +00:00
tuexen
d2bb6d5d23 MFC r287281:
Report CLOSED as state for bound sockets for consistency with
netstat and the way TCP is handled.
2016-01-17 18:39:01 +00:00
tuexen
d13520b3c7 MFC r287182:
Add SCTP support.
2016-01-17 18:37:36 +00:00