Commit Graph

100745 Commits

Author SHA1 Message Date
Ruslan Bukin
2d3f1b38a9 Provide a character device allowing us to access BERI memory regions.
Sponsored by:	DARPA, AFRL
2014-10-22 11:30:03 +00:00
Mateusz Guzik
58a3dcb229 filedesc assert that table size is at least 3 in fdsetugidsafety
Requested by: kib
2014-10-22 08:56:57 +00:00
Hans Petter Selasky
c61ee529ff Actually change the USB_PORT_ROOT_RESET_DELAY definition as stated in
the r241987 commit message, instead of having users locally overriding
the value using tunables in /boot/loader.conf .

Found by:	Adam Parco
Discussed with:	Nick Hibma
2014-10-22 07:50:19 +00:00
Hans Petter Selasky
6007751fa3 Allow overspecification of SYSCTL type in external kernel modules.
PR:		194523
MFC after:	3 days
2014-10-22 07:16:46 +00:00
Luigi Rizzo
03be41e6a4 remove/fix old code for building ipfw and dummynet in userspace 2014-10-22 05:21:36 +00:00
Mateusz Guzik
4bc68ed7bc Plug unnecessary PRS_NEW check in kern_procctl.
pfind does not return processes in such state.
2014-10-22 04:16:09 +00:00
Kevin Lo
b1c5d8f7c3 Fix the kernel panic in hostap mode.
rvp->beacon_mbuf was NULL in run_update_beacon().

PR:	189405
Submitted by:	Gabor Simon <gabor.simon75 at gmail.com>
MFC after:	3 days
2014-10-22 03:32:27 +00:00
Mateusz Guzik
a39d200bb9 Reduce nesting in vn_access.
No functional changes.
2014-10-22 01:53:00 +00:00
Marcel Moolenaar
2c383f119e Virtual machines can easily have more than 16 option ROMs and
when that happens, we happily access our resource array out of
bounds. Make sure we stay within the MAX_ROMS limit.
While here, bump MAX_ROMS from 16 to 32 to minimize the chance
of leaving option ROMs unaccounted for.

Obtained from:	Juniper Networks, Inc.
2014-10-22 01:37:32 +00:00
Warner Losh
4a8b493f81 Add defines for various FIRST PARTY DMA SEND subcommands. 2014-10-22 01:35:30 +00:00
Mateusz Guzik
eac9678110 Avoid crdup when possible in kern_accessat.
While here tidy up a little.
2014-10-22 01:09:07 +00:00
Mateusz Guzik
11888da8d9 filedesc: cleanup setugidsafety a little
Rename it to fdsetugidsafety for consistency with other functions.

There is no need to take filedesc lock if not closing any files.

The loop has to verify each file and we are guaranteed fdtable has space
for at least 20 fds. As such there is no need to check fd_lastfile.

While here tidy up is_unsafe.
2014-10-22 00:23:43 +00:00
Mateusz Guzik
07b384cbe2 Eliminate unnecessary memory allocation in sys_getgroups and its ibcs2 counterpart. 2014-10-21 23:08:46 +00:00
Glen Barber
668026383c Bump __FreeBSD_version to track SA-14:20, SA-14:21, SA-14:22,
SA-14:23

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-10-21 21:37:53 +00:00
Mateusz Guzik
2afec8edfc Take the lock shared in linker_search_symbol_name.
This helps sysctl kern.proc.stack.
2014-10-21 21:29:20 +00:00
Mateusz Guzik
12e2a30ef9 tmpfs: allow shared file lookups
Tested by: pho
2014-10-21 21:27:13 +00:00
Mateusz Guzik
fca7732078 Mark some more sysctl stuff shared-locked and MPSAFE. 2014-10-21 21:08:45 +00:00
Hans Petter Selasky
71aea8c84b Use the UAUTO SYSCTL type for exporting the bounce zone alignment,
because the variable size depends on the build type.

Reported by:	kib @
MFC after:	3 days
2014-10-21 21:04:44 +00:00
Mateusz Guzik
b564c5d6aa Make sysctl name2oid shared-locked as well.
This is a follow-up to r273401.
2014-10-21 19:45:08 +00:00
Glen Barber
c379cfaf3c Fix an issue where a FreeBSD virtual machine provisioned in
the Microsoft Azure service does not recognize the second
attached disk on the system.

Submitted by:	kyliel@Microsoft
Patched by:	weh@Microsoft
PR:		194376
MFC after:	3 days
X-MFC-10.1:	yes, ASAP
Sponsored by:	The FreeBSD Foundation
2014-10-21 19:36:20 +00:00
Mateusz Guzik
efe0abddf5 Implement shared locking for sysctl. 2014-10-21 19:05:44 +00:00
Mateusz Guzik
580a011762 Rename sysctl_lock and _unlock to sysctl_xlock and _xunlock. 2014-10-21 19:02:26 +00:00
Jim Harris
83a4c3f99e ixl: remove i40e_register_x710_int.h
This file is not used by the FreeBSD ixl driver.

Submitted by:	Eric Joyner <eric.joyner@intel.com>
MFC after:	3 days
2014-10-21 18:00:56 +00:00
Ruslan Bukin
8b62915e24 Add driver for Micrel KSZ9021 Gigabit Ethernet Transceiver (PHY).
Sponsored by:	DARPA, AFRL
2014-10-21 09:14:16 +00:00
Hans Petter Selasky
4db0aba3b2 Fix minor typo in currently unused macro.
MFC after:	3 days
2014-10-21 07:49:34 +00:00
Hans Petter Selasky
f0188618f2 Fix multiple incorrect SYSCTL arguments in the kernel:
- Wrong integer type was specified.

- Wrong or missing "access" specifier. The "access" specifier
sometimes included the SYSCTL type, which it should not, except for
procedural SYSCTL nodes.

- Logical OR where binary OR was expected.

- Properly assert the "access" argument passed to all SYSCTL macros,
using the CTASSERT macro. This applies to both static- and dynamically
created SYSCTLs.

- Properly assert the the data type for both static and dynamic
SYSCTLs. In the case of static SYSCTLs we only assert that the data
pointed to by the SYSCTL data pointer has the correct size, hence
there is no easy way to assert types in the C language outside a
C-function.

- Rewrote some code which doesn't pass a constant "access" specifier
when creating dynamic SYSCTL nodes, which is now a requirement.

- Updated "EXAMPLES" section in SYSCTL manual page.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2014-10-21 07:31:21 +00:00
Kevin Lo
7eb884645c Add the Intel BayTrail USB device which needs port routing for USB 3.0.
Tested on the BayTrail E3845 platform.
Reviewed by:	hselasky
2014-10-21 07:24:58 +00:00
Neel Natu
a78dc03254 Merge projects/bhyve_svm into HEAD.
After this change bhyve supports AMD processors with the SVM/AMD-V hardware
extensions.

More details available here:
https://lists.freebsd.org/pipermail/freebsd-virtualization/2014-October/002905.html

Submitted by:	Anish Gupta (akgupt3@gmail.com)
Tested by:	Benjamin Perrault (ben.perrault@gmail.com)
Tested by:	Willem Jan Withagen (wjw@digiware.nl)
2014-10-21 07:10:43 +00:00
Bryan Venteicher
854f7e89e6 Use the size of the Ethernet address, not the entire header, when
copying into forwarding entry.

Reported by:	Coverity
CID:		1248849
2014-10-21 05:45:57 +00:00
Neel Natu
408ea86538 IFC @r273338 2014-10-21 01:57:36 +00:00
Pyun YongHyeon
b8333e4546 It seems multicast filtering of RTL8168F does not work. Workaround
the silicon bug by accepting any multicast packets.

PR:	193488
MFC After:	1 week
2014-10-21 01:31:24 +00:00
Neel Natu
a5045426db Fix a race in pmap_emulate_accessed_dirty() that could trigger a EPT
misconfiguration VM-exit.

An EPT misconfiguration is triggered when the processor encounters a PTE
that is writable but not readable (WR=10). On processors that require A/D
bit emulation PG_M and PG_A map to EPT_PG_WRITE and EPT_PG_READ respectively.

If the PTE is updated as in the following code snippet:
	*pte |= PG_M;
	*pte |= PG_A;
then it is possible for another processor to observe the PTE after the PG_M
(aka EPT_PG_WRITE) bit is set but before PG_A (aka EPT_PG_READ) bit is set.

This will trigger an EPT misconfiguration VM-exit on the other processor.

Reported by:	rodrigc
Reviewed by:	grehan
MFC after:	3 days
2014-10-21 01:06:58 +00:00
Ian Lepore
52d99877ba Attach the imx6 CCM driver during BUS_PASS_CPU. It controls the clocks
for most on-chip devices and needs to be available before other drivers
start attaching and asking to have their clocks enabled.
2014-10-20 23:34:47 +00:00
Ian Lepore
c90fadc0d2 The imx6 hardware is fast enough to make good use of however much
timecounter resolution is available, so ask for a 1 GHz frequency.  It
won't actually get one that fast, but that'll get the fastest available
clock and use a divisor of 1 (probably 132 or 66mhz on current hardware).
2014-10-20 23:32:34 +00:00
Mateusz Guzik
5c37b305fd Plug unnecessary binvp NULL initialization and test.
Reported by: Coverity
CID: 1018889
2014-10-20 22:52:15 +00:00
Mateusz Guzik
966ee9f25f filedesc: plug 2 write-only variables
Reported by: Coverity
CID: 1245745, 1245746
2014-10-20 21:57:24 +00:00
Mark Johnston
4fd6ca7275 Fix a typo from r189544, which replaced unp_global_rwlock with unp_list_lock
and unp_link_rwlock.

MFC after:	3 days
2014-10-20 20:21:40 +00:00
Neel Natu
e011dc962c Merge from projects/bhyve_svm all the changes outside vmm.ko or bhyve utilities:
Add support for AMD's nested page tables in pmap.c:
- Provide the correct bit mask for various bit fields in a PTE (e.g. valid bit)
  for a pmap of type PT_RVI.
- Add a function 'pmap_type_guest(pmap)' that returns TRUE if the pmap is of
  type PT_EPT or PT_RVI.

Add CPU_SET_ATOMIC_ACQ(num, cpuset):
This is used when activating a vcpu in the nested pmap. Using the 'acquire'
variant guarantees that the load of the 'pm_eptgen' will happen only after
the vcpu is activated in 'pm_active'.

Add defines for various AMD-specific MSRs.

Submitted by:	Anish Gupta (akgupt3@gmail.com)
2014-10-20 18:09:33 +00:00
Luiz Otavio O Souza
71b37cb9ae Fix the mtx_sleep() error checking, catch all errors and not only
EWOULDBLOCK.

Do not print any message at errors.  The errors are properly sent to upper
layers which should be able to deal with it, including printing the errors
when they need to.

The error message was quite annoying while scanning the i2c bus.

MFC after:	1 week
2014-10-20 18:04:20 +00:00
Mateusz Guzik
4fce16e4c9 Provide vfs suspension support only for filesystems which need it, take
two.

nullfs and unionfs need to request suspension if underlying filesystem(s)
use it. Utilize mnt_kern_flag for this purpose.

This is a fixup for 273271.

No strong objections from: kib
Pointy hat to: mjg
MFC after:	2 weeks
2014-10-20 18:00:50 +00:00
Mateusz Guzik
a8a07fd613 unionfs: hold mount interlock while manipulating mnt_flag
This is for consistency with other filesystems.
2014-10-20 17:53:49 +00:00
Marcel Moolenaar
0067051fe7 Fully support constructors for the purpose of code coverage analysis.
This involves:
1.  Have the loader pass the start and size of the .ctors section to the
    kernel in 2 new metadata elements.
2.  Have the linker backends look for and record the start and size of
    the .ctors section in dynamically loaded modules.
3.  Have the linker backends call the constructors as part of the final
    work of initializing preloaded or dynamically loaded modules.

Note that LLVM appends the priority of the constructors to the name of
the .ctors section. Not so when compiling with GCC. The code currently
works for GCC and not for LLVM.

Submitted by:	Dmitry Mikulin <dmitrym@juniper.net>
Obtained from:	Juniper Networks, Inc.
2014-10-20 17:04:03 +00:00
Bryan Venteicher
007054f070 Add vxlan interface
vxlan creates a virtual LAN by encapsulating the inner Ethernet frame in
a UDP packet. This implementation is based on RFC7348.

Currently, the IPv6 support is not fully compliant with the specification:
we should be able to receive UPDv6 packets with a zero checksum, but we
need to support RFC6935 first. Patches for this should come soon.

Encapsulation protocols such as vxlan emphasize the need for the FreeBSD
network stack to support batching, GRO, and GSO. Each frame has to make
two trips through the network stack, and each frame will be at most MTU
sized. Performance suffers accordingly.

Some latest generation NICs have begun to support vxlan HW offloads that
we should also take advantage of. VIMAGE support should also be added soon.

Differential Revision:	https://reviews.freebsd.org/D384
Reviewed by:	gnn
Relnotes:	yes
2014-10-20 14:42:42 +00:00
Jean-Sébastien Pédron
2113857ae0 vt(4): Refuse to load a font if hw.vga.textmode is selected
Before, the font was loaded and the window size recalculated, giving an
unusable terminal, even if the actual font didn't change.

Reported by:	beeessdee@ruggedinbox.com
MFC after:	3 days
2014-10-20 14:25:23 +00:00
Luiz Otavio O Souza
a141b6722c Add another wakeup() after actually set the bus as free.
This fix a race where the threads waiting for the bus would wake up early
and still see bus as busy.

While here, give a better description to wmesg for the two use cases we
have (bus and io waiting).

MFC after:	1 week
2014-10-20 13:36:52 +00:00
Alexander Motin
7bac11c78c Add another PCI ID for JMB368 PATA controller.
MFC after:	1 week
2014-10-20 13:18:52 +00:00
Alexander V. Chernikov
54b38fcf03 Use copyout() directly instead of updating various fields
before/after each sooptcopyout() call.

Found by:	luigi
Sponsored by:	Yandex LLC
2014-10-20 11:21:07 +00:00
Neel Natu
e1a172e1c2 IFC @r273214 2014-10-20 02:57:30 +00:00
Ian Lepore
db8aa5fd6d The U-Boot README says fdt_addr_r is the right env var for fdt data
loaded into ram, but vendors also use fdtaddr and fdt_addr.  Check the
recommended variable first and fall back to the others.
2014-10-20 01:52:17 +00:00
Neel Natu
867b59607c IFC @r273206 2014-10-19 23:05:18 +00:00