Commit Graph

103754 Commits

Author SHA1 Message Date
Neel Natu
fe22991fb8 Emulate MSR_SYSCFG which is accessed by Linux on AMD cpus when MTRRs are
enabled.

MFC after:	2 weeks
2015-05-01 05:11:14 +00:00
Eric Joyner
3b5d5c3f54 Fix build by adding ixgbe_x550.c to sys/conf/files for ixgbe.
Submitted by:	neel
Approved by:	jfv (mentor)
2015-05-01 03:33:31 +00:00
Eric Joyner
e845dfe9bf Include makefiles necessary to make ixgbe build with the new code.
Originally supposed to be included in r282289.

Differential Revision: D2414
2015-04-30 22:56:43 +00:00
Eric Joyner
6f37f2324d Add support for certain Intel X550 devices.
These include standalone X550 adapters, X552 10GbE backplane, and
X552/X557-AT 10GBASE-T; with the latter two being integrated into Xeon D SoCs.

As well, this bumps the ixgbe version number to 2.8.3, and includes updates
to shared code for support for the new devices.

Differential Revision: D2414
Reviewed by:	gnn, adrian
Approved by:	jfv (mentor), gnn (mentor)
2015-04-30 22:53:27 +00:00
Neel Natu
8325ce5c7e Don't require <sys/cpuset.h> to be always included before <machine/vmm.h>.
Only a subset of source files that include <machine/vmm.h> need to use the
APIs that require the inclusion of <sys/cpuset.h>.

MFC after:	1 week
2015-04-30 22:23:22 +00:00
Alexander V. Chernikov
caf993912e Fix KASSERT introduced in r282155.
Found by:	dhw
2015-04-30 21:51:12 +00:00
Neel Natu
c07a0648ec When an instruction cannot be decoded just return to userspace so bhyve(8)
can dump the instruction bytes.

Requested by:	grehan
MFC after:	1 week
2015-04-30 21:00:47 +00:00
Mariusz Zaborski
b7be86aca6 Mark local function as static as a result of removing recursion.
Approved by:	pjd (mentor)
2015-04-30 20:50:42 +00:00
Mariusz Zaborski
45fd5ced7b Rename macros to use prefix ERRNO. Add macro ERRNO_SET. Now
ERRNO_{RESTORE/SAVE} must by used together, additional variable is not
needed. Always use ERRNO_{SAVE/RESTORE/SET} macros.

Approved by:	pjd (mentor)
2015-04-30 20:47:33 +00:00
Neel Natu
7d786ee2a9 Advertise the MTRR feature via CPUID and emulate the minimal set of MTRR MSRs.
This is required for booting Windows guests.

Reported by:	Leon Dang (ldang@nahannisys.com)
MFC after:	2 weeks
2015-04-30 19:23:50 +00:00
John Baldwin
625d12c609 Various fixes to the stats in igb(4), ixgbe(4), and ixl(4).
- Use hardware counters for ifnet stats in igb(4) when possible.  This
  ensures these stats include packets that bypass the regular stack via
  netmap.
- Don't derefence values off the end of the igb(4) VF stats structure.
  Instead, add a dedicated if_get_counter method for igb(4) VF interfaces.
- Report missed packets on igb(4) as input queue drops rather than an
  input error.
- Report bug_ring drop counts as output queue drops for igb(4) and ixgbe(4).
- Export the buf_ring drop stats for individual rings via sysctl on
  ixgbe(4).
- Fix a typo that in ixl(4) that caused output queue drops to be reported
  as input queue drops and input queue drops to be unreported.

Differential Revision:	https://reviews.freebsd.org/D2402
Reviewed by:	jfv, rstone (6)
Sponsored by:	Norse Corp, Inc.
2015-04-30 18:23:38 +00:00
Jung-uk Kim
59023e6ce2 Remove leftover from r282269.
MFC after:	2 weeks
X-MFC with:	r282269
2015-04-30 17:49:35 +00:00
George V. Neville-Neil
bee68e9400 Move the SIFTR DTrace probe out of the writing thread context
and directly into the place where the data is collected.
2015-04-30 17:43:40 +00:00
John Baldwin
ed95805e90 Remove support for Xen PV domU kernels. Support for HVM domU kernels
remains.  Xen is planning to phase out support for PV upstream since it
is harder to maintain and has more overhead.  Modern x86 CPUs include
virtualization extensions that support HVM guests instead of PV guests.
In addition, the PV code was i386 only and not as well maintained recently
as the HVM code.
- Remove the i386-only NATIVE option that was used to disable certain
  components for PV kernels.  These components are now standard as they
  are on amd64.
- Remove !XENHVM bits from PV drivers.
- Remove various shims required for XEN (e.g. PT_UPDATES_FLUSH, LOAD_CR3,
  etc.)
- Remove duplicate copy of <xen/features.h>.
- Remove unused, i386-only xenstored.h.

Differential Revision:	https://reviews.freebsd.org/D2362
Reviewed by:	royger
Tested by:	royger (i386/amd64 HVM domU and amd64 PVH dom0)
Relnotes:	yes
2015-04-30 15:48:48 +00:00
Roger Pau Monné
b19f7eece6 atkbd: remove usage of x86bios
Instead of trying to get the keyboard repeat rate set by the BIOS just set a
default one. This allows removing the usage of x86bios from atkbd.

Sponsored by: Citrix Systems R&D
Reviewed by: jkim, delphij
Differential Revision: https://reviews.freebsd.org/D2399
MFC after: 2 weeks
2015-04-30 07:00:25 +00:00
Justin Hibbits
f23bfc6841 Also happened to miss this in r282264. 2015-04-30 04:44:41 +00:00
Justin Hibbits
6f489d43c8 Missed ofw_machdep.c in r282264. 2015-04-30 03:15:07 +00:00
Kevin Lo
32bbc2d0bb - Disable usb aggregation mode by default since it boots performance
- Minor tweak

PR:	199718
Submitted by:	Mikhail <mp39590 at gmail dot com>
2015-04-30 02:47:21 +00:00
Justin Hibbits
6c8df58287 Unify booke and AIM machdep.
Much of the code was common to begin with.  There is one nit, which is likely
not an issue at all.  With the old code, the AIM machdep would __syncicache()
the entire kernel core at setup.  However, in the unified setup, that seems to
hang on the MPC7455, perhaps because it's running later than before.  Removing
this allows it to boot just fine.  Examining the code, the FreeBSD loader
already does syncicache of the full kernel, and each module loaded, so this
doesn't appear to be an actual problem.

Initial code by Nathan Whitehorn.
2015-04-30 01:24:25 +00:00
Neel Natu
787fb3d026 Re-implement RTC current time calculation to eliminate the possibility of
losing time.

The problem with the earlier implementation was that the uptime value
used by 'vrtc_curtime()' could be different than the uptime value when
'vrtc_time_update()' actually updated 'base_uptime'.

Fix this by calculating and updating the (rtctime, uptime) tuple together.

MFC after:	2 weeks
2015-04-29 23:44:28 +00:00
Mariusz Zaborski
be73922fcd Save errno from close override.
Approved by:	pjd (mentor)
2015-04-29 22:59:44 +00:00
Mariusz Zaborski
0bb5e6ef80 Remove the nvlist_.*[fv] functions.
Those functions are problematic, because there is no way to report
memory allocation problems without complicating the API, so we can
either abort or potentially return invalid results. None of which is
acceptable.

In most cases the caller knows the size of the name, so he can allocate
buffer on the stack and use snprintf(3) to prepare the name.

After some discussion the conclusion is to removed those functions,
which also simplifies the API.

Discussed with: pjd, rstone
Approved by:	pjd (mentor)
2015-04-29 22:57:04 +00:00
Michael Gmelin
681476b551 Bump __FreeBSD_version for smb(4) changes in r281985
Differential Revision:	https://reviews.freebsd.org/D2398
Reviewed by:	bapt, flo
Approved by:	bapt, flo
2015-04-29 22:50:41 +00:00
Mariusz Zaborski
3cfb71c186 Remove recursion from descriptor-related functions.
Approved by:	pjd (mentor)
2015-04-29 22:15:02 +00:00
Mariusz Zaborski
44c125c4ce Nvlist functionality is not used within interrupt context, so we should
use M_WAITOK to allocate memory.

Approved by:	pjd (mentor)
2015-04-29 22:00:26 +00:00
Mariusz Zaborski
003e3ea15b Always use the nv_malloc macro instead of malloc(3).
Approved by:	pjd (mentor)
2015-04-29 21:54:34 +00:00
Mariusz Zaborski
906289c2ec Style fixes.
Approved by:	pjd (mentor)
2015-04-29 21:50:04 +00:00
Ed Maste
2c48063b30 vt: fix vt_fb_bitblt_bitmap mask corruption
Previously the mask wrapped when one or more of the mask bytes extended
past the right edge of the window. Simplify the logic and use the same
byte offset and bit in both the pattern and mask.

PR:		199648
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2360
2015-04-29 20:30:11 +00:00
Pedro F. Giffuni
1faac5bc09 Revert r281889:
The change would appease the static analyzers but it is pretty much a
no-op. I need to trust static analyzers much less, especially for the
kernel.

Requested by:	jkim
2015-04-29 20:08:03 +00:00
John Baldwin
4dc78216f8 Don't free mbufs when stopping an interface in netmap mode.
Currently if you ifconfig down a vtnet interface while it is being used
via netmap, the kernel panics due to trying to treat the cookie values
in the virtio rings as mbufs to be freed. When netmap is enabled, these
cookie values are pointers to something else.

Note that other netmap-aware drivers don't seem to need this as they
store the mbuf pointers in the software rings that mirror the hardware
descriptor rings, and since netmap doesn't touch those, the software
state always has NULL mbuf pointers causing the loops to free mbufs to
not do anything. However, vtnet reuses the same state area for both
netmap and non-netmap mode, so it needs to explicitly avoid looking at
the rings and treating the cookie values as mbufs if netmap is
enabled.

Differential Revision:	https://reviews.freebsd.org/D2348
Reviewed by:	adrian, bryanv, luigi
MFC after:	1 week
Sponsored by:	Norse Corp, Inc.
2015-04-29 17:48:25 +00:00
George V. Neville-Neil
981ad3ecf9 Brief demo script showing the various values that can be read via
the new SIFTR statically defined tracepoint (SDT).

Differential Revision:	https://reviews.freebsd.org/D2387
Reviewed by:	bz, markj
2015-04-29 17:19:55 +00:00
Scott Long
16be867406 Revert r282227. It is clearly incorrect as it frees an object that is still
referenced.  I think that there does exist an unlikely edge case for a
memory leak, but only if a driver is incorrectly written and specifies no
valid range of targets to scan.  That can be fixed in a follow-up commit.

Obtained from:	Netflix, Inc.
2015-04-29 17:18:41 +00:00
Scott Long
affc4a4bff Improve support for blacklisting bad memory locations. The user can supply
a text file with a list of physical memory addresses to exclude, and have it
loaded at boot time via the provided example in loader.conf.  The tunable
'vm.blacklist' remains, but using an external file means that there's no
practical limit to the size of the list.  This change also improves the
scanning algorithm for processing the list, scanning the list only once
instead of scanning it for every page in the system.  Both the sysctl and
the file can be unsorted and contain duplicates so long as each entry is
numeric (decimal or hex) and is separated by a space, comma, or newline
character.  The sysctl 'vm.page_blacklist' is now provided to report what
memory locations were successfully excluded.

Reviewed by:	imp, emax
Obtained from:	Netflix, Inc.
MFC after:	3 days
2015-04-29 15:57:14 +00:00
Pedro F. Giffuni
bfce3bb269 Fix memory leak in scsi_scan_bus()
CID:	1007770
PR:	199671
2015-04-29 15:46:57 +00:00
Pedro F. Giffuni
3b7176c90a Plug memory leaks in kbdmux(4) (take 2)
This is a fix to the previous attempt in r281889, which some (most?)
keyboards.

Discussed with:	emaste, jkim

Found by:	clang static analyzer
CID:		1007072
CID:		1007073
CID:		1007074
2015-04-29 15:41:19 +00:00
Andrew Turner
85ffc58684 Add pmap_mapbios and pmap_unmapbios. These will be needed to support acpi.
Sponsored by:	The FreeBSD Foundation
2015-04-29 15:00:43 +00:00
Roger Pau Monné
f0e31fe074 vt_vga: add a timeout while waiting for vertical retrace
On one of my systems FreeBSD will fail to boot because vt_vga gets stuck
waiting for the vertical retrace if there's no monitor attached. Fix this by
adding a timeout and exiting if the vertical retrace times out.

Sponsored by: Citrix Systems R&D
Reviewed by: emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D2397
2015-04-29 12:53:41 +00:00
George V. Neville-Neil
3e126de6bd Make it possible to statically link SIFTR into the kernel
as a new option.

Reviewed by:	bz
Discussed with:	lstewart
MFC after:	2 weeks
2015-04-29 12:37:45 +00:00
Edward Tomasz Napierala
4b5c9cf62f Add kern.racct.enable tunable and RACCT_DISABLED config option.
The point of this is to be able to add RACCT (with RACCT_DISABLED)
to GENERIC, to avoid having to rebuild the kernel to use rctl(8).

Differential Revision:	https://reviews.freebsd.org/D2369
Reviewed by:	kib@
MFC after:	1 month
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2015-04-29 10:23:02 +00:00
Wei Hu
da2f98a1cf Microsoft vmbus, storage and other related driver enhancements for HyperV.
- Vmbus multi channel support.
    - Vector interrupt support.
    - Signal optimization.
    - Storvsc driver performance improvement.
    - Scatter and gather support for storvsc driver.
    - Minor bug fix for KVP driver.
Thanks royger, jhb and delphij from FreeBSD community for the reviews
and comments. Also thanks Hovy Xu from NetApp for the contributions to
the storvsc driver.

PR:     195238
Submitted by:   whu
Reviewed by:    royger, jhb, delphij
Approved by:    royger
MFC after:      2 weeks
Relnotes:       yes
Sponsored by:   Microsoft OSTC
2015-04-29 10:12:34 +00:00
Adrian Chadd
1a8fd8faac Constify some const parameters in seq.h.
The NUMA work I'm doing uses const for read-only parameters, which requires
the seq.h API to also use const for read-only parameters.

Reviewed by:	mjg
2015-04-29 04:08:17 +00:00
Neel Natu
b8070ef5b1 Emulate the 'bit test' instruction. Windows 7 uses 'bit test' to check the
'Delivery Status' bit in APIC ICR register.

Reported by:	Leon Dang (ldang@nahannisys.com)
MFC after:	2 weeks
2015-04-29 02:01:46 +00:00
Warner Losh
2e8457e701 Only include CWARNFLAGS once to reduce command line size from ~1400
characters to "only" ~900 for kernel builds.
2015-04-28 23:54:55 +00:00
Neel Natu
f39630c2d6 Implement the century byte in the RTC. Some guests require this field to be
properly set.

Reported by:	Leon Dang (ldang@nahannisys.com)
MFC after:	2 weeks
2015-04-28 23:44:47 +00:00
Steven Hartland
aeb9d4dad9 Fix misuse of input argument in traverse_visitbp
In traverse_visitbp(), the input argument dnp is modified in the middle
to point to a temporary buffer. Originally this doesn't matter, because
no user of TRAVERSE_POST dereferences it. However, in fbeddd6 a piece of
code is added dereferencing dnp after the modification, creating a possible
bug.

We fix this by creating a new local variable cdnp for the DMU_OT_DNODE case,
so we don't modify the input argument. Also we introduce different local
variables in the DMU_OT_OBJSET case to prevent confusion between the input
argument.

Obtained from:	zfsonlinux (a585f2f844ed3d4270221fed88f5e494eb55d932)
MFC after:	2 weeks
Sponsored by:	Multiplay
2015-04-28 22:46:58 +00:00
Ruslan Bukin
a74af3dc69 o Fix bus_space_read_multi functions: correct increment value
o Use these functions for streaming

Tested with ATA (PCI bus) / Gem5 simulator

Reviewed by:	andrew
Sponsored by:	HEIF5
2015-04-28 20:33:31 +00:00
Alexander V. Chernikov
e948489558 Fix panic introduced by r282070.
Arm friendly KASSERT() to ease debug of similar crashes.

Submitted by:	Olivier Cochard-Labbé
2015-04-28 17:05:55 +00:00
Andrew Turner
3b7f258a4d Allow the arm64 config file to define SOCDEV_PA and SOCDEV_VA that may be
used in locore.S to map an extra range when enabling the MMU.
2015-04-28 17:02:43 +00:00
Andrew Turner
d588c3d64a Only enable the hpet driver on x86 hardware, it doesn't exist on arm64.
Sponsored by:	The FreeBSD Foundation
2015-04-28 16:51:48 +00:00
Andrew Turner
2a1803d048 Fix pmap_dcache_wb_pou in the new armv6 pmap to correctly achieve icache
consistency from ptrace.

PR:		199739
Submitted by:	Jurgen Weiss <weiss at uni-mainz.de> (original version)
Submitted by:	Svatopluk Kraus <onwahe at gmail.com>
2015-04-28 16:47:34 +00:00