102423 Commits

Author SHA1 Message Date
marius
afd8ff0c41 MFC: r281337
Don't enable RX and TX before their initial configuration is done, i. e.
after setting up interrupt moderation but before turning interrupts on.
This matches what Realtek's r8168 Linux driver does as of version 8.039.00
and fixes problems with certain incarnations of certain MAC revisions
like the interface requiring an extra up/down-cycle after boot to start
working or DMA configuration not being adhered to.

PR:		193743, 197535
Approved by:	re (kib)
2015-07-05 20:16:38 +00:00
marius
882f03214b MFC: r281751
Refine the workaround for Intel HSD131 [1] added in r269052 (MFCed to
stable/10 in r269592):
- Use the full mask described by the erratum as with a sufficiently high
  number of these false-positives, the overflow bit (bit 62) additionally
  gets set [7].
- HSD131 has been brought into several other Haswell-derived CPUs including
  to the next generation, i. e. Intel Broadwell. Thus, also skip reporting of
  these benign errors by default on CPU models affected by HSM142, HSW131 and
  BDM48 [2 - 5], describing the HSD131 silicon bug for additional models.
  Also, Celeron 2955U with a CPU ID of 0x45 have been reported to be covered
  by this fault [6], with the specification update concerned with HSM142 [2]
  only referring to 0x3c and 0x46.

Submitted by:	David Froehlich [7]
Approved by:	re (kib)

http://www.intel.de/content/dam/www/public/us/en/documents/specification-updates/4th-gen-core-family-desktop-specification-update.pdf [1]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/4th-gen-core-family-mobile-specification-update.pdf [2]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/5th-gen-core-family-spec-update.pdf [3]
http://www.intel.de/content/dam/www/public/us/en/documents/specification-updates/core-m-processor-family-spec-update.pdf [4]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-e3-1200v3-spec-update.pdf [5]
https://lists.freebsd.org/pipermail/freebsd-hackers/2015-January/046878.html [6]
2015-07-05 19:32:10 +00:00
gjb
4d6a99d3a9 Add the GEOM_LABEL option to the BEAGLEBONE, GUMSTIX, and RPI-B
kernel configuration files, resolving an issue where the UFS and
MSDOSFS partitions would not mount as set in fstab(5).

This is a direct commit to stable/10, as the GEOM_LABEL option
is handled differently in head for arm/armv6.  The WANDBOARD
and PANDABOARD already have this kernel option entry via the IMX6
kernel configuration file, so do not need to be changed.

Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2015-07-04 14:50:32 +00:00
sjg
63c8b34326 Latest clang uses openat(2).
If the pathname is absolute or dirfd is AT_FDCWD we can
handle it exactly like open(2).
Otherwise we output an A record to indicate that the path of
an open directory needs to be used (earlier in the trace).

Also filemon_pid_check needs to hold proctree_lock
and use proc_realparent()

Differential Revision:  D2810
Reviewed by: jhb
Approved by: re
2015-07-03 20:43:31 +00:00
emaste
fda669645d MFC r269137 by marcel:
Add missing definition of ELF_MACHINE_OK, now used by gcore(1).

PR:	201204
2015-07-02 18:27:04 +00:00
kp
f1fbe0ce5b MFC r284348: Fix panic when adding vtnet interfaces to a bridge
vtnet interfaces are always in promiscuous mode (at least if the
VIRTIO_NET_F_CTRL_RX feature is not negotiated with the host).  if_promisc() on
a vtnet interface returned ENOTSUP although it has IFF_PROMISC set. This
confused the bridge code. Instead we now accept all enable/disable promiscuous
commands (and always keep IFF_PROMISC set).

There are also two issues with the if_bridge error handling.

If if_promisc() fails it uses bridge_delete_member() to clean up. This tries to
disable promiscuous mode on the interface. That runs into an assert, because
promiscuous mode was never set in the first place. (That's the panic reported in
PR 200210.)
We can only unset promiscuous mode if the interface actually is promiscuous.
This goes against the reference counting done by if_promisc(), but only the
first/last if_promic() calls can actually fail, so this is safe.

A second issue is a double free of bif. It's already freed by
bridge_delete_member().

PR:         200210
2015-07-01 21:21:14 +00:00
neel
b396223254 MFC r284712:
Restore the host's GS.base before returning from 'svm_launch()' so the Dtrace
FBT provider works with vmm.ko on AMD.
2015-07-01 19:46:57 +00:00
avg
3a7588b223 MFC r278153,284416: ttm memory allocation improvements
If the vm_page_alloc_contig() failed in the ttm page allocators, do
what other callers of vm_page_alloc_contig() do, retry after
vm_pageout_grow_cache().

ttm_vm_page_alloc: use vm_page_alloc for pages without dma32 restriction
This change re-organizes code a little bit to extract common pieces
of ttm_alloc_new_pages() and ttm_get_pages() into dedicated functions.
Also, for requests without address restrictions regular vm_page_alloc()
is used.
Lastly, when vm_page_alloc_contig() fails we call VM_WAIT before calling
vm_pageout_grow_cache() to ensure that there is enough free pages at
all.

Note: no MFC to stable/9 because it lacks vm_pageout_grow_cache().
2015-07-01 11:28:42 +00:00
avg
b6a3e408bb MFC r284304: MFV r284030: 5818 zfs {ref}compressratio is incorrect with 4k sector size
Note: no MFC to stable/9 because r268075 (vendor r267565) has not been MFC-ed.
2015-07-01 10:47:13 +00:00
avg
97017b18a6 MFC r284297: several lockstat improvements 2015-07-01 10:15:49 +00:00
kib
febe4e6e91 MFC r284495:
Keep a vnode which is freed but still owing inactivation, on the active list.
This closes a race where such vnode is not msync-ed until reboot.
2015-07-01 06:54:25 +00:00
davidcs
854f0423fc MFC r284741
Updated Copyright information
Added support for the following:
     - iSCSI TLV (requires 64 Tx and 32 Rx rings
     - 9K receive buffers for jumbo frames (feature may be enabled/disabled)
     - builtin firmware, bootloader and minidump template
     - quick stats
     - async event handling for SFP insertion/removal and DCBX changes
     - Configuring DCBX and interrupt coalescing parameters
2015-06-30 20:59:07 +00:00
davidcs
3be46b6bd7 MFC r284739
tx_mtx should be grabbed before calling buf_ring_dequeue_sc()

Submitted by:Attilio.Rao@isilon.com
2015-06-30 18:58:33 +00:00
davidcs
9a7cb4f2b0 MFC r284470
In bxe_init_mcast_macs_list(): mc_mac->mac needs to point to the multicast mac address
In bxe_set_mc_list(): added missing BXE_MCAST_UNLOCK()
In __ecore_vlan_mac_h_exec_pending(): need to check for ECORE_PENDING

Submitted by:	gary.zambrano@qlogic.com
2015-06-30 17:59:14 +00:00
davidcs
61a04dd609 MFC r284335
PHY LOCK acquires the hardware lock via bxe_acquire_phy_lock() and releases it via bxe_release_phy_lock(). It was simply acquiring a mutex earlier which can cause the PHY to use bogus values. Fixes intermittent link failures.

bxe_ioctl() completes all functions within its context as opposed to a taskqueue earlier.

bxe_handle_rx_mode_tq() no longer required. bxe_set_rx_mode() handles the functionality within its context

Submitted by:	gary.zambrano@qlogic.com
2015-06-30 17:44:44 +00:00
erj
8a1f7539e0 Re-add if_hw_tso* assignments to if_ix.c that were removed in r283668.
These are used in stable/10 as well as 11.

Requested by:	rmacklem@
2015-06-30 16:26:13 +00:00
tijl
1ab2e62a0d MFC r284858:
Enable the use of __builtin_va_* for ICC.

PR:		198822
Submitted by:	Sergey Melnikov <sergey.melnikov@intel.com>
2015-06-30 08:40:15 +00:00
kib
6499094e0c MFC r284719:
Only take previous buffer queue lock (olock) when needed for REMFREE
in binsfree().
2015-06-30 05:53:15 +00:00
delphij
1dfaa82c6b MFC r284792:
Merge changes from vendor driver 1.1.4:

  v1.1.4 2015-06-09
   * Fix a bug that FailLED was not initialized properly.
  v1.1.3 2015-05-19
   * Support Report Luns command.
  v1.1.2 2015-05-05
   * Fix a bug that report wrong physical sector size for 512e HDD.

Many thanks to HighPoint for continued support of FreeBSD!

This driver update is intended for 10.2-RELEASE.

Submitted by:	Steve Chang
2015-06-29 18:34:30 +00:00
mav
ffe8bc5e2d MFC r284808: Remove limitations on setting WWNNs starting from 2.
It is odd that driver first tries to generate synthetic WWNN based on
WWPN starting from 2, but then refuses to use it.  If we don't trust
generated WWNN, we should probably not generate it.  Same time this
limitation prevents potentially valid WWNN setting by user.
2015-06-28 09:27:34 +00:00
mav
43d71d4cfd MFC r284748: Fix reported_gone setting, missed in some cases.
This makes driver better track reported CAM_SEL_TIMEOUTs to properly
report device reappearance later.  This fixes target 0 not reappearing
after initiator mode disabled and then reenabled.
2015-06-28 09:26:14 +00:00
mav
66c5039388 MFC r284727: Add dev.isp.X.role sysctl in addition to tunable.
It (mostly) allows to enable/disable initiator mode in run time.
Target mode control is blocked here to force coordination with CTL.

While there, add separate tunables/sysctls for virtual channels.
2015-06-28 09:25:13 +00:00
mav
3da4ce5b58 MFC r284681: Rewrite port database handling for target mode.
Previous implementation was too fragile to initiator parameters changes.
In case of port role change it could not survive different handle assigned
to the same initiator by firmware, even though initiator was logged out.
The new implementation should be more resillient to this kind of problems,
trying to work in any situation and only warn user about suspisious events.
2015-06-28 09:24:02 +00:00
neel
79b96fdbcb MFC r282209:
Emulate the 'bit test' instruction.

MFC r282259:
Re-implement RTC current time calculation to eliminate the possibility of
losing time.

MFC r282281:
Advertise the MTRR feature via CPUID and emulate the minimal set of MTRR MSRs.

MFC r282284:
When an instruction cannot be decoded just return to userspace so bhyve(8)
can dump the instruction bytes.

MFC r282287:
Don't require <sys/cpuset.h> to be always included before <machine/vmm.h>.

MFC r282296:
Emulate MSR_SYSCFG which is accessed by Linux on AMD cpus when MTRRs are
enabled.

MFC r282301:
Relax limits when transitioning a vector from the IRR to the ISR and also
when extinguishing it from the ISR in response to an EOI.

MFC r282335:
Advertise an additional memory BAR in the "dummy" device emulation.

MFC r282336:
Emulate machine check related MSRs to allow guest OSes like Windows to boot.

MFC r282351:
Don't advertise the Intel SMX capability to the guest.

MFC r282407:
Emulate the 'CMP r/m8, imm8' instruction.

MFC r282519:
Add macros for AMD-specific bits in MSR_EFER: LMSLE, FFXSR and TCE.

MFC r282520:
Emulate guest writes to EFER_MSR properly.

MFC r282558:
Deprecate the 3-way return values from vm_gla2gpa() and vm_copy_setup().

MFC r282571:
Check 'td_owepreempt' and yield the vcpu thread if it is set.

MFC r282595:
Allow byte reads of AHCI registers.

MFC r282784:
Handling indirect descriptors is a capability of the host and not one that
needs to be negotiated. Use the host capabilities field and not the negotiated
field when verifying that indirect descriptors are supported.

MFC r282788:
Allow configuration of the sector size advertised to the guest.

MFC r282865:
Set the subvendor field in config space to the vendor ID. This is required
by the Windows virtio drivers to correctly match a device.

MFC r282922:
Bump the size of the blockif scatter-gather list to 67.

MFC r283075:
Fix off-by-one in array index bounds check. bhyveload would allow you to
create 33 entries on an array that only has 32 slots

MFC r283168:
Temporarily revert r282922 which bumped the max descriptors.

MFC r283255:
Emulate the "CMP r/m, reg" instruction (opcode 39H).

MFC r283256:
Add an option "--get-vmcs-exit-inst-length" to display the instruction length
of the instruction that caused the VM-exit.

MFC r283264:
Change the header type of the emulated host-bridge from type 1 to type 0.

MFC r283293:
Don't rely on the 'VM-exit instruction length' field in the VMCS to always
have an accurate length on an EPT violation.

MFC r283299:
Remove bogus verification of instruction length after instruction decode.

MFC r283308:
Exceptions don't deliver an error code in real mode.

MFC r283657:
Fix non-deterministic delays when accessing a vcpu that was in "running" or
"sleeping" state.

MFC r283973:
Use tunable 'hw.vmm.svm.features' to disable specific SVM features even
though they might be available in hardware. Use tunable 'hw.vmm.svm.num_asids'
to limit the number of ASIDs used by the hypervisor.

MFC r284046:
Fix regression in 'verify_gla()' with the RIP-relative addressing mode.

MFC r284174:
Support guest writes to the TSC by enabling the "use TSC offsetting"
execution control.
2015-06-28 03:22:26 +00:00
neel
c85aee0195 MFC r279444:
Allow passthrough devices to be hinted.

MFC r279683:
When ICW1 is issued the edge sense circuit is reset which means that
following an initialization a low-to-high transistion is necesary to
generate an interrupt.

MFC r279925:
Add -p parameter to list PCI device to pass through to the guest.

MFC r281559:
Fix handling of BUS_PROBE_NOWILDCARD in 'device_probe_child()'.

MFC r280447:
When fetching an instruction in non-64bit mode, consider the value of the
code segment base address.

MFC r280725:
Move legacy interrupt allocation for virtio devices to common code.

MFC r280775:
Fix the RTC device model to operate correctly in 12-hour mode.

MFC r280929:
Fix "MOVS" instruction memory to MMIO emulation.

MFC r280968:
Display instruction bytes and %rip prior to aborting due to an instruction
emulation error.

MFC r281145:
Enhance the support for Group 1 Extended opcodes for CMP, AND, OR instructions.

MFC r281542:
Initialize 'error' before use (Coverity IDs 1249748, 1249747, 1249751, 1249749)

MFC r281561:
Prior to aborting due to an ioport error, it is always interesting to see what
the guest's %rip is.

MFC r281611:
If the number of guest vcpus is less than '1' then flag it as an error.

MFC r281612:
Prefer 'vcpu_should_yield()' over checking 'curthread->td_flags' directly.

MFC r281630:
Relax the check on which vectors can be delivered through the APIC. According
to the Intel SDM vectors 16 through 255 are allowed to be delivered via the
local APIC.

MFC r281879:
Missing break in switch case (Coverity ID 1292499)

MFC r281946:
Don't allow guest to modify readonly bits in the PCI config 'status' register.

MFC r281987:
STOS/STOSB/STOSW/STOSD/STOSQ instruction emulation.

MFC r282206:
Implement the century byte in the RTC.
2015-06-28 01:21:55 +00:00
neel
115742fae3 MFC r276428:
Replace bhyve's minimal RTC emulation with a fully featured one in vmm.ko.

MFC r276432:
Initialize all fields of 'struct vm_exception exception' before passing it
to vm_inject_exception().

MFC r276763:
Clear blocking due to STI or MOV SS in the hypervisor when an instruction is
emulated or when the vcpu incurs an exception.

MFC r277149:
Clean up usage of 'struct vm_exception' to only to communicate information
from userspace to vmm.ko when injecting an exception.

MFC r277168:
Fix typo (missing comma).

MFC r277309:
Make the error message explicit instead of just printing the usage if the
virtual machine name is not specified.

MFC r277310:
Simplify instruction restart logic in bhyve.

MFC r277359:
Fix a bug in libvmmapi 'vm_copy_setup()' where it would return success even
if the 'gpa' was in the guest MMIO region.

MFC r277360:
MOVS instruction emulation.

MFC r277626:
Add macro to identify AVIC capability (advanced virtual interrupt controller)
in AMD processors.

MFC r279220:
Don't close a block context if it couldn't be opened avoiding a null deref.

MFC r279225:
Add "-u" option to bhyve(8) to indicate that the RTC should maintain UTC time.

MFC r279227:
Emulate MSR 0xC0011024 when running on AMD processors.

MFC r279228:
Always emulate MSR_PAT on Intel processors and don't rely on PAT save/restore
capability of VT-x. This lets bhyve run nested in older VMware versions that
don't support the PAT save/restore capability.

MFC r279540:
Fix warnings/errors when building vmm.ko with gcc.
2015-06-27 22:48:22 +00:00
hselasky
45502dd8d1 MFC r284743:
Rename __weak to __weak_symbol to avoid language conflict with objective-C.

PR:		200972 (exp-run)
Suggested by:	theraven@
2015-06-26 21:35:36 +00:00
delphij
5a956cd60a MFC r267386,269611,284730:
Update vendor driver to 1.2.7.  This update improves driver reliability and
adds support of 4Kn drives and report LUNs command.

Many thanks to HighPoint for providing this driver update.
2015-06-26 19:55:01 +00:00
erj
36ff8dde86 Limit the number of autoconfigured queues to 8.
This limit was in a previous version of the driver, but it is being re-
added to match the behavior of previous versions of 10. It prevents the
driver from using too many MSI-X vectors on systems with a large number of
logical CPU cores.

Thanks to <jwd@slowblink.com> for bringing up this issue.

Approved by:	jfv (mentor)
2015-06-26 17:13:23 +00:00
kib
575dc6a9d5 MFC r284594:
Restore the td_cookie value upon detach.
2015-06-26 06:25:14 +00:00
arybchik
ebdd57af7d MFC: r284747
sfxge: skip VPD info population if access is denied

The patch allows to run on unprivileged PF (PFIOV) passed to
a virtual machine.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
2015-06-26 06:08:52 +00:00
mav
d99396f96d MFC r284698: Dump additional config bytes for INIT_FIRMWARE_MULTI_ID. 2015-06-25 07:25:40 +00:00
mav
5c47554b55 MFC r284697: Add logging of executed mailbox command names.
Previously those commands were logged only as part of register dump,
that is not very readable.
2015-06-25 07:24:47 +00:00
mav
77eb863bb6 MFC r284540:
In case of target mode disable at least ISP2532 return invalid zero
ct_rxid value on CTIO completion.  Try to workaround that using tag_id
from the CCB, pointed by still valid ct_syshandle.

I don't know whether this is valid fix or dirty hack, but considering that
alternative is indefinitely stuck command -- it worth trying.
2015-06-25 07:23:35 +00:00
mav
9451fd94b7 MFC r274675 (by jhb), r274708:
Convert the refire_notify_ack timer from timeout(9) to callout(9).
2015-06-25 07:22:37 +00:00
mav
6646999316 MFC r284640: Bring per-port LUN enable/disable code up to date:
- remove last remnants of never implemented multiple targets support;
 - implement missing support for LUN mapping in this area.

Due to existing locking constraints LUN mapping code is practically
unlocked at this point.  Hopefully it is not racy enough to live until
somebody get idea how to call sleeping fronend methods under lock also
taken by the same frontend in non-sleepable context. :(
2015-06-25 07:11:48 +00:00
mav
0aff133da5 MFC r284627: Remove some dead and duplicate LUN enabling code. 2015-06-25 07:10:51 +00:00
mav
701d4d43cb MFC r284639: Introduce separate lock for tokens to reduce ctl_lock scope. 2015-06-25 07:09:39 +00:00
mav
3bd447f679 MFC r284641:
Fix REPORT LUNS command output for the case when same LUN mapped to same
port several times.  While it is unusual configuration, it is not illegal.
2015-06-25 07:08:46 +00:00
mav
912011aeb8 MFC r284622: Remove device queue freeze handling and replace it with dummy.
At this point CTL has no known use case for device queue freezes.
Same time existing (considered to be broken) code was found to cause
modify-after-free issues.
2015-06-25 07:07:32 +00:00
mav
fc8d3d0aa2 MFC r284541:
Change ATIO/INOT counting to prevent periph destruction while requests
are still running inside CTL.
2015-06-25 07:06:24 +00:00
eri
5d11dcc720 MFC r284512: Properly handle locking on the ARP protocol request sending. 2015-06-24 19:06:54 +00:00
avg
f8c30d3e15 MFC r284306: MFV r284036: 5961 Fix stack overflow in zfs_create_fs 2015-06-24 14:41:54 +00:00
avg
d3f01929a8 MFC r284303: MFV r283534: 5515 dataset user hold doesn't reject empty tags 2015-06-24 14:39:26 +00:00
avg
f0758faa12 MFC r284301: MFV r284040: check that datasets are snapshots 2015-06-24 14:37:55 +00:00
gallatin
00b69b27e8 Fix r284612: As pointed out by jhb, in stable branches, if_baudrate
is 32b on 32b platforms.  So rather than a simple MFC of r284612,
we need to use if_initbaudrate() to properly express a 40Gb speed.

Spotted by: jhb
Sponsored by: Netflix
2015-06-23 22:31:04 +00:00
kib
ae7c0e0461 Revert part of the r283303 (by jhb):
Revert MFC of r270223, which bumped MAXCPU on amd64 from 64 to 256.
The cpuset_getaffinity(2) and cpuset_setaffinity(2) check minimum set
size, which now fails for binaries compiled on 10.0 with MAXCPU == 64.

Submitted by:	jhb
PR:	  200802
2015-06-23 06:30:36 +00:00
dteske
3822c7142e MFC r284672 (antoine):
Install version.4th.8 again
It was disconnected from installation in r281081, but was never removed
from the tree or added to ObsoleteFiles.inc
2015-06-23 03:56:05 +00:00
gallatin
a152d5e40f MFC r284612: Fix a typo
Sponsored by:	Netflix
2015-06-22 19:37:04 +00:00
tuexen
7e040df666 When using KTRACE, set a variable to the appropriate value and don't
leave it initialized at NULL.
Since the affected functions where moved from sys/kern/uipc_syscalls.c
to sys/netinet/sctp_syscalls.c it was not possible to MFC r284613.
Therefore, this is a direct commit with the corresponding changes of r284613.

Reported by:	Coverity
CID:		1018058, 1018060
2015-06-22 06:06:38 +00:00